@elementor/editor-elements 4.0.0-573 → 4.0.0-597

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
@@ -1,4 +1,4 @@
1
- import { PropsSchema, SizePropValue, PropValue, Props, LinkPropValue } from '@elementor/editor-props';
1
+ import { PropsSchema, PropValue, SizePropValue, Props, LinkPropValue } from '@elementor/editor-props';
2
2
  import { ClassState, StyleDefinitionID, StyleDefinition, StyleDefinitionVariant } from '@elementor/editor-styles';
3
3
  import * as _elementor_editor_v1_adapters from '@elementor/editor-v1-adapters';
4
4
 
@@ -7,12 +7,17 @@ type Element = {
7
7
  id: ElementID;
8
8
  type: string;
9
9
  };
10
+ type PseudoState = {
11
+ name: string;
12
+ value: string;
13
+ };
10
14
  type ElementType = {
11
15
  key: string;
12
16
  controls: ControlItem[];
13
17
  propsSchema: PropsSchema;
14
18
  dependenciesPerTargetMapping?: Record<string, string[]>;
15
19
  styleStates?: ClassState[];
20
+ pseudoStates?: PseudoState[];
16
21
  title: string;
17
22
  };
18
23
  type ControlsSection = {
@@ -123,6 +128,7 @@ type AnimationPresetPropValue = {
123
128
  $$type: 'animation-preset-props';
124
129
  value: {
125
130
  effect: StringPropValue;
131
+ custom_effect?: PropValue;
126
132
  type: StringPropValue;
127
133
  direction: StringPropValue;
128
134
  timing_config: TimingConfigPropValue;
@@ -189,6 +195,7 @@ type V1ElementConfig<T = object> = {
189
195
  base_styles?: Record<string, StyleDefinition>;
190
196
  base_styles_dictionary?: Record<string, string>;
191
197
  atomic_style_states?: ClassState[];
198
+ atomic_pseudo_states?: PseudoState[];
192
199
  show_in_panel?: boolean;
193
200
  meta?: {
194
201
  [key: string]: string | number | boolean | null | NonNullable<V1ElementConfig['meta']>;
@@ -482,4 +489,4 @@ declare const updateElementInteractions: ({ elementId, interactions, }: {
482
489
  }) => void;
483
490
  declare const playElementInteractions: (elementId: string, interactionId: string) => void;
484
491
 
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 };
492
+ 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 PseudoState, 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
@@ -1,4 +1,4 @@
1
- import { PropsSchema, SizePropValue, PropValue, Props, LinkPropValue } from '@elementor/editor-props';
1
+ import { PropsSchema, PropValue, SizePropValue, Props, LinkPropValue } from '@elementor/editor-props';
2
2
  import { ClassState, StyleDefinitionID, StyleDefinition, StyleDefinitionVariant } from '@elementor/editor-styles';
3
3
  import * as _elementor_editor_v1_adapters from '@elementor/editor-v1-adapters';
4
4
 
@@ -7,12 +7,17 @@ type Element = {
7
7
  id: ElementID;
8
8
  type: string;
9
9
  };
10
+ type PseudoState = {
11
+ name: string;
12
+ value: string;
13
+ };
10
14
  type ElementType = {
11
15
  key: string;
12
16
  controls: ControlItem[];
13
17
  propsSchema: PropsSchema;
14
18
  dependenciesPerTargetMapping?: Record<string, string[]>;
15
19
  styleStates?: ClassState[];
20
+ pseudoStates?: PseudoState[];
16
21
  title: string;
17
22
  };
18
23
  type ControlsSection = {
@@ -123,6 +128,7 @@ type AnimationPresetPropValue = {
123
128
  $$type: 'animation-preset-props';
124
129
  value: {
125
130
  effect: StringPropValue;
131
+ custom_effect?: PropValue;
126
132
  type: StringPropValue;
127
133
  direction: StringPropValue;
128
134
  timing_config: TimingConfigPropValue;
@@ -189,6 +195,7 @@ type V1ElementConfig<T = object> = {
189
195
  base_styles?: Record<string, StyleDefinition>;
190
196
  base_styles_dictionary?: Record<string, string>;
191
197
  atomic_style_states?: ClassState[];
198
+ atomic_pseudo_states?: PseudoState[];
192
199
  show_in_panel?: boolean;
193
200
  meta?: {
194
201
  [key: string]: string | number | boolean | null | NonNullable<V1ElementConfig['meta']>;
@@ -482,4 +489,4 @@ declare const updateElementInteractions: ({ elementId, interactions, }: {
482
489
  }) => void;
483
490
  declare const playElementInteractions: (elementId: string, interactionId: string) => void;
484
491
 
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 };
492
+ 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 PseudoState, 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.js CHANGED
@@ -247,7 +247,8 @@ function getElementType(type) {
247
247
  propsSchema: elementType.atomic_props_schema,
248
248
  dependenciesPerTargetMapping: elementType.dependencies_per_target_mapping ?? {},
249
249
  title: elementType.title,
250
- styleStates: elementType.atomic_style_states ?? []
250
+ styleStates: elementType.atomic_style_states ?? [],
251
+ pseudoStates: elementType.atomic_pseudo_states ?? []
251
252
  };
252
253
  }
253
254
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/hooks/use-element-children.ts","../src/sync/get-container.ts","../src/sync/model-utils.ts","../src/hooks/use-element-editor-settings.ts","../src/sync/get-element-editor-settings.ts","../src/hooks/use-element-setting.ts","../src/sync/get-element-setting.ts","../src/hooks/use-parent-element.ts","../src/hooks/use-selected-element.ts","../src/sync/get-widgets-cache.ts","../src/sync/get-element-type.ts","../src/sync/get-selected-elements.ts","../src/sync/create-element.ts","../src/sync/create-elements.ts","../src/sync/delete-element.ts","../src/sync/drop-element.ts","../src/sync/duplicate-element.ts","../src/sync/duplicate-elements.ts","../src/sync/generate-element-id.ts","../src/sync/get-current-document-container.ts","../src/sync/get-current-document-id.ts","../src/errors.ts","../src/sync/get-element-label.ts","../src/sync/get-element-styles.ts","../src/sync/get-all-descendants.ts","../src/sync/get-elements.ts","../src/sync/move-element.ts","../src/sync/move-elements.ts","../src/sync/remove-elements.ts","../src/sync/replace-element.ts","../src/sync/update-element-editor-settings.ts","../src/sync/update-element-settings.ts","../src/link-restriction.ts","../src/styles/consts.ts","../src/styles/create-element-style.ts","../src/styles/mutate-element-styles.ts","../src/styles/delete-element-style.ts","../src/styles/update-element-style.ts","../src/hooks/use-element-interactions.ts","../src/sync/get-element-interactions.ts","../src/sync/update-element-interactions.ts"],"sourcesContent":["// types\nexport * from './types';\nexport type * from './sync/types';\n\n// hooks\nexport { useElementChildren, type ElementChildren, type ElementModel } from './hooks/use-element-children';\nexport { useElementEditorSettings } from './hooks/use-element-editor-settings';\nexport { useElementSetting, useElementSettings } from './hooks/use-element-setting';\nexport { useParentElement } from './hooks/use-parent-element';\nexport { useSelectedElement } from './hooks/use-selected-element';\n\n// utils\nexport { createElement, type CreateElementParams } from './sync/create-element';\nexport { createElements } from './sync/create-elements';\nexport { deleteElement } from './sync/delete-element';\nexport { dropElement, type DropElementParams } from './sync/drop-element';\nexport { duplicateElement, type DuplicateElementParams } from './sync/duplicate-element';\nexport {\n\tduplicateElements,\n\ttype DuplicatedElement,\n\ttype DuplicatedElementsResult,\n\ttype DuplicateElementsParams,\n} from './sync/duplicate-elements';\nexport { generateElementId } from './sync/generate-element-id';\nexport { getContainer, selectElement } from './sync/get-container';\nexport { getCurrentDocumentContainer } from './sync/get-current-document-container';\nexport { getCurrentDocumentId } from './sync/get-current-document-id';\nexport { getElementEditorSettings } from './sync/get-element-editor-settings';\nexport { getElementLabel } from './sync/get-element-label';\nexport { getElementSetting, getElementSettings } from './sync/get-element-setting';\nexport { getElementStyles } from './sync/get-element-styles';\nexport { getElementType } from './sync/get-element-type';\nexport { getAllDescendants } from './sync/get-all-descendants';\nexport {\n\tfindChildRecursive,\n\tgetElementChildren as getElementChildrenWithFallback,\n\ttype ModelResult,\n} from './sync/model-utils';\nexport { getElements } from './sync/get-elements';\nexport { getSelectedElements } from './sync/get-selected-elements';\nexport { getWidgetsCache } from './sync/get-widgets-cache';\nexport { moveElement, type MoveElementParams } from './sync/move-element';\nexport { moveElements } from './sync/move-elements';\nexport { removeElements } from './sync/remove-elements';\nexport { replaceElement } from './sync/replace-element';\nexport { updateElementEditorSettings } from './sync/update-element-editor-settings';\nexport { updateElementSettings, type UpdateElementSettingsArgs } from './sync/update-element-settings';\n\nexport {\n\tgetAnchoredAncestorId,\n\tgetAnchoredDescendantId,\n\tgetLinkInLinkRestriction,\n\tisElementAnchored,\n\ttype LinkInLinkRestriction,\n} from './link-restriction';\nexport { ELEMENT_STYLE_CHANGE_EVENT, styleRerenderEvents } from './styles/consts';\nexport {\n\tcreateElementStyle,\n\tshouldCreateNewLocalStyle,\n\ttype CreateElementStyleArgs,\n} from './styles/create-element-style';\nexport { deleteElementStyle } from './styles/delete-element-style';\nexport { updateElementStyle, type UpdateElementStyleArgs } from './styles/update-element-style';\n\nexport { useElementInteractions } from './hooks/use-element-interactions';\nexport { getElementInteractions } from './sync/get-element-interactions';\nexport { playElementInteractions, updateElementInteractions } from './sync/update-element-interactions';\n","import { __privateUseListenTo as useListenTo, commandEndEvent, v1ReadyEvent } from '@elementor/editor-v1-adapters';\n\nimport { getContainer } from '../sync/get-container';\nimport { findChildRecursive, getElementChildren, type ModelResult } from '../sync/model-utils';\nimport { type V1ElementEditorSettingsProps } from '../sync/types';\nimport { type ElementID } from '../types';\n\nexport type ElementModel = {\n\tid: string;\n\teditorSettings: V1ElementEditorSettingsProps;\n};\n\nexport type ElementChildren = Record< string, ElementModel[] >;\n\nfunction toElementModel( { model }: ModelResult ): ElementModel {\n\treturn {\n\t\tid: model.get( 'id' ) as string,\n\t\teditorSettings: model.get( 'editor_settings' ) ?? {},\n\t};\n}\n\nexport function useElementChildren< T extends ElementChildren >(\n\telementId: ElementID,\n\tchildrenTypes: Record< string, string >\n): T {\n\treturn useListenTo(\n\t\t[\n\t\t\tv1ReadyEvent(),\n\t\t\tcommandEndEvent( 'document/elements/create' ),\n\t\t\tcommandEndEvent( 'document/elements/delete' ),\n\t\t\tcommandEndEvent( 'document/elements/update' ),\n\t\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t],\n\t\t() => {\n\t\t\tconst container = getContainer( elementId );\n\t\t\tconst model = container?.model;\n\n\t\t\tif ( ! model ) {\n\t\t\t\treturn {} as ElementChildren;\n\t\t\t}\n\n\t\t\tconst elementChildren = Object.entries( childrenTypes ).reduce( ( acc, [ parentType, childType ] ) => {\n\t\t\t\tconst parent = findChildRecursive( model, ( m ) => m.get( 'elType' ) === parentType );\n\n\t\t\t\tif ( ! parent ) {\n\t\t\t\t\tacc[ childType ] = [];\n\t\t\t\t\treturn acc;\n\t\t\t\t}\n\n\t\t\t\tconst children = getElementChildren( parent.model, ( m ) => m.get( 'elType' ) === childType );\n\n\t\t\t\tacc[ childType ] = children.map( toElementModel );\n\n\t\t\t\treturn acc;\n\t\t\t}, {} as ElementChildren );\n\n\t\t\treturn elementChildren;\n\t\t},\n\t\t[ elementId ]\n\t) as T;\n}\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\n\nimport { type ExtendedWindow, type V1Element } from './types';\n\nexport function getContainer( id: string ): V1Element | null {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\tconst container = extendedWindow.elementor?.getContainer?.( id );\n\n\treturn container ?? null;\n}\n\nexport const selectElement = ( elementId: string ) => {\n\ttry {\n\t\tconst container = getContainer( elementId );\n\n\t\trunCommand( 'document/elements/select', { container } );\n\t} catch {}\n};\n","import { type V1Element } from './types';\n\nexport type V1Model = V1Element[ 'model' ];\n\nexport type V1Collection = V1Model[] & {\n\tremove: ( model: V1Model ) => void;\n\tadd: ( model: V1Model, options?: { at?: number }, silent?: boolean ) => void;\n\tindexOf: ( model: V1Model ) => number;\n};\n\nexport type ModelResult = {\n\tmodel: V1Model;\n};\n\nexport function findChildRecursive( model: V1Model, predicate: ( model: V1Model ) => boolean ): ModelResult | null {\n\tconst childModels = ( model.get( 'elements' ) ?? [] ) as V1Model[];\n\n\tfor ( const childModel of childModels ) {\n\t\tif ( predicate( childModel ) ) {\n\t\t\treturn { model: childModel };\n\t\t}\n\n\t\tconst found = findChildRecursive( childModel, predicate );\n\n\t\tif ( found ) {\n\t\t\treturn found;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function getElementChildren( model: V1Model, predicate?: ( model: V1Model ) => boolean ): ModelResult[] {\n\tconst childModels = ( model.get( 'elements' ) ?? [] ) as V1Model[];\n\n\treturn childModels\n\t\t.filter( ( childModel ) => ! predicate || predicate( childModel ) )\n\t\t.map( ( childModel ) => ( { model: childModel } ) );\n}\n","import { __privateUseListenTo as useListenTo, windowEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementEditorSettings } from '../sync/get-element-editor-settings';\nimport { type ElementID } from '../types';\n\nexport const useElementEditorSettings = ( elementId: ElementID ) => {\n\treturn useListenTo(\n\t\twindowEvent( 'elementor/element/update_editor_settings' ),\n\t\t() => getElementEditorSettings( elementId ),\n\t\t[ elementId ]\n\t);\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport function getElementEditorSettings( elementId: ElementID ) {\n\tconst container = getContainer( elementId );\n\n\treturn container?.model.get( 'editor_settings' ) ?? {};\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementSetting } from '../sync/get-element-setting';\nimport { type ElementID } from '../types';\n\nexport const useElementSetting = < TValue >( elementId: ElementID, settingKey: string ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t() => getElementSetting< TValue >( elementId, settingKey ),\n\t\t[ elementId, settingKey ]\n\t);\n};\n\nexport const useElementSettings = < TValue >( elementId: ElementID, settingKeys: string[] ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t() =>\n\t\t\tsettingKeys.reduce< Record< string, TValue > >( ( settings, key ) => {\n\t\t\t\tconst value = getElementSetting< TValue >( elementId, key );\n\n\t\t\t\tif ( value !== null ) {\n\t\t\t\t\tsettings[ key ] = value;\n\t\t\t\t}\n\n\t\t\t\treturn settings;\n\t\t\t}, {} ),\n\t\t[ elementId, settingKeys.join( ',' ) ]\n\t);\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport const getElementSetting = < TValue >( elementId: ElementID, settingKey: string ): TValue | null => {\n\tconst container = getContainer( elementId );\n\n\treturn ( container?.settings?.get( settingKey ) as TValue ) ?? null;\n};\n\nexport const getElementSettings = < TValue >(\n\telementId: ElementID,\n\tsettingKey: string[]\n): Record< string, TValue | null > => {\n\treturn Object.fromEntries( settingKey.map( ( key ) => [ key, getElementSetting( elementId, key ) ] ) );\n};\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { type ExtendedWindow } from '../sync/types';\n\nexport function useParentElement( elementId: string | null ) {\n\treturn useListenTo(\n\t\t[ commandEndEvent( 'document/elements/create' ) ],\n\t\t() => {\n\t\t\tif ( ! elementId ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst extendedWindow = window as unknown as ExtendedWindow;\n\t\t\tconst element = extendedWindow?.elementor?.getContainer?.( elementId );\n\t\t\tif ( ! element ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn element.parent;\n\t\t},\n\t\t[ elementId ]\n\t);\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementType } from '../sync/get-element-type';\nimport { getSelectedElements } from '../sync/get-selected-elements';\n\nexport function useSelectedElement() {\n\tconst elements = useListenTo(\n\t\t[\n\t\t\tcommandEndEvent( 'document/elements/select' ),\n\t\t\tcommandEndEvent( 'document/elements/deselect' ),\n\t\t\tcommandEndEvent( 'document/elements/select-all' ),\n\t\t\tcommandEndEvent( 'document/elements/deselect-all' ),\n\t\t],\n\t\tgetSelectedElements\n\t);\n\n\tconst [ element ] = elements;\n\n\tconst elementType = getElementType( element?.type );\n\n\tif ( elements.length !== 1 || ! elementType ) {\n\t\treturn { element: null, elementType: null };\n\t}\n\n\treturn { element, elementType };\n}\n","import { type ExtendedWindow, type V1ElementConfig } from '../sync/types.js';\ntype WidgetsCache< T > = Record< string, T >;\n\nexport function getWidgetsCache< T extends V1ElementConfig >(): WidgetsCache< T > | null {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn ( extendedWindow?.elementor?.widgetsCache as WidgetsCache< T > ) || null;\n}\n","import { type ElementType } from '../types';\nimport { getWidgetsCache } from './get-widgets-cache';\n\nexport function getElementType( type: string ): ElementType | null {\n\tif ( ! type ) {\n\t\treturn null;\n\t}\n\n\tconst widgetsCache = getWidgetsCache();\n\tconst elementType = widgetsCache?.[ type ];\n\n\tif ( ! elementType?.atomic_controls ) {\n\t\treturn null;\n\t}\n\n\tif ( ! elementType?.atomic_props_schema ) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tkey: type,\n\t\tcontrols: elementType.atomic_controls,\n\t\tpropsSchema: elementType.atomic_props_schema,\n\t\tdependenciesPerTargetMapping: elementType.dependencies_per_target_mapping ?? {},\n\t\ttitle: elementType.title,\n\t\tstyleStates: elementType.atomic_style_states ?? [],\n\t};\n}\n","import { type Element } from '../types';\nimport { type ExtendedWindow } from './types';\n\nexport function getSelectedElements(): Element[] {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\tconst selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];\n\n\treturn selectedElements.reduce< Element[] >( ( acc, el ) => {\n\t\tconst type = el.model.get( 'widgetType' ) || el.model.get( 'elType' );\n\n\t\tif ( type ) {\n\t\t\tacc.push( {\n\t\t\t\tid: el.model.get( 'id' ),\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\n\t\treturn acc;\n\t}, [] );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element, type V1ElementModelProps, type V1ElementSettingsProps } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tclone?: boolean;\n};\n\nexport type CreateElementParams = {\n\tcontainer: V1Element;\n\tmodel?: Omit< V1ElementModelProps, 'settings' | 'id' > & { settings?: V1ElementSettingsProps; id?: string };\n\toptions?: Options;\n};\n\nexport function createElement( { container, model, options }: CreateElementParams ): V1Element {\n\treturn runCommandSync< V1Element >( 'document/elements/create', {\n\t\tcontainer,\n\t\tmodel,\n\t\toptions: { edit: false, ...options },\n\t} );\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement, type CreateElementParams } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype CreateElementsParams = {\n\telements: CreateElementParams[];\n\ttitle: string;\n\tsubtitle?: string;\n};\n\ntype CreatedElement = {\n\tcontainer: V1Element;\n\tparentContainer: V1Element;\n\tmodel: V1ElementModelProps;\n\toptions?: CreateElementParams[ 'options' ];\n};\n\ntype CreatedElementsResult = {\n\tcreatedElements: CreatedElement[];\n};\n\nexport type { CreateElementsParams, CreatedElement, CreatedElementsResult };\n\nexport const createElements = ( {\n\telements,\n\ttitle,\n\tsubtitle = __( 'Item added', 'elementor' ),\n}: CreateElementsParams ): CreatedElementsResult => {\n\tconst undoableCreate = undoable(\n\t\t{\n\t\t\tdo: ( { elements: elementsParam }: { elements: CreateElementParams[] } ): CreatedElementsResult => {\n\t\t\t\tconst createdElements: CreatedElement[] = [];\n\n\t\t\t\telementsParam.forEach( ( { container, options, ...elementParams } ) => {\n\t\t\t\t\tconst parentContainer = container.lookup?.() ?? container;\n\n\t\t\t\t\tif ( ! parentContainer ) {\n\t\t\t\t\t\tthrow new Error( 'Parent container not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tconst element = createElement( {\n\t\t\t\t\t\tcontainer: parentContainer,\n\t\t\t\t\t\t...elementParams,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tcreatedElements.push( {\n\t\t\t\t\t\tcontainer: element,\n\t\t\t\t\t\tparentContainer,\n\t\t\t\t\t\tmodel: element.model?.toJSON() || {},\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { createdElements };\n\t\t\t},\n\t\t\tundo: ( _: { elements: CreateElementParams[] }, { createdElements }: CreatedElementsResult ) => {\n\t\t\t\t[ ...createdElements ].reverse().forEach( ( { container } ) => {\n\t\t\t\t\tconst freshContainer = container.lookup?.();\n\n\t\t\t\t\tif ( freshContainer ) {\n\t\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elements: CreateElementParams[] },\n\t\t\t\t{ createdElements }: CreatedElementsResult\n\t\t\t): CreatedElementsResult => {\n\t\t\t\tconst newElements: CreatedElement[] = [];\n\n\t\t\t\tcreatedElements.forEach( ( { parentContainer, model, options } ) => {\n\t\t\t\t\tconst freshParent = parentContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshParent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst element = createElement( {\n\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewElements.push( {\n\t\t\t\t\t\tcontainer: element,\n\t\t\t\t\t\tparentContainer: freshParent,\n\t\t\t\t\t\tmodel: element.model.toJSON(),\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { createdElements: newElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableCreate( { elements } );\n};\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n};\n\ntype DeleteElementParams = {\n\tcontainer: V1Element;\n\toptions?: Options;\n};\n\nexport function deleteElement( { container, options = {} }: DeleteElementParams ): Promise< void > {\n\treturn runCommand( 'document/elements/delete', {\n\t\tcontainer,\n\t\toptions,\n\t} );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps, type V1ElementSettingsProps } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tscrollIntoView: boolean;\n};\n\nexport type DropElementParams = {\n\tcontainerId: string;\n\toptions?: Options;\n\tmodel?: Omit< V1ElementModelProps, 'settings' | 'id' > & { settings?: V1ElementSettingsProps; id?: string };\n};\n\nexport function dropElement( { containerId, model, options }: DropElementParams ) {\n\tconst container = getContainer( containerId );\n\n\tif ( ! container ) {\n\t\tthrow new Error( `Container with ID \"${ containerId }\" not found` );\n\t}\n\n\treturn runCommandSync< V1Element >( 'preview/drop', {\n\t\tcontainer,\n\t\tmodel,\n\t\toptions,\n\t} );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tclone?: boolean;\n};\n\nexport type DuplicateElementParams = {\n\telement: V1Element;\n\toptions?: Options;\n};\n\nexport function duplicateElement( { element, options = {} }: DuplicateElementParams ): V1Element {\n\tconst currentIndex = element.view?._index ?? 0;\n\tconst insertPosition = options.clone !== false ? currentIndex + 1 : undefined;\n\n\treturn runCommandSync< V1Element >( 'document/elements/duplicate', {\n\t\tcontainer: element,\n\t\toptions: { at: insertPosition, edit: false, ...options },\n\t} );\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { duplicateElement } from './duplicate-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype DuplicateElementsParams = {\n\telementIds: string[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonDuplicateElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype DuplicatedElement = {\n\tcontainer: V1Element;\n\tparentContainer: V1Element;\n\tmodel: V1ElementModelProps;\n\tat?: number;\n};\n\ntype DuplicatedElementsResult = {\n\tduplicatedElements: DuplicatedElement[];\n};\n\nexport type { DuplicateElementsParams, DuplicatedElement, DuplicatedElementsResult };\n\nexport const duplicateElements = ( {\n\telementIds,\n\ttitle,\n\tsubtitle = __( 'Item duplicated', 'elementor' ),\n\tonDuplicateElements,\n\tonRestoreElements,\n}: DuplicateElementsParams ): DuplicatedElementsResult => {\n\tconst undoableDuplicate = undoable(\n\t\t{\n\t\t\tdo: ( { elementIds: elementIdsToDuplicate }: { elementIds: string[] } ): DuplicatedElementsResult => {\n\t\t\t\tonDuplicateElements?.();\n\t\t\t\tconst duplicatedElements: DuplicatedElement[] = [];\n\n\t\t\t\telementIdsToDuplicate.forEach( ( elementId ) => {\n\t\t\t\t\tconst originalContainer = getContainer( elementId );\n\n\t\t\t\t\tif ( ! originalContainer?.parent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst duplicatedElement = duplicateElement( {\n\t\t\t\t\t\telement: originalContainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( ! duplicatedElement.parent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tduplicatedElements.push( {\n\t\t\t\t\t\tcontainer: duplicatedElement,\n\t\t\t\t\t\tparentContainer: duplicatedElement.parent,\n\t\t\t\t\t\tmodel: duplicatedElement.model.toJSON(),\n\t\t\t\t\t\tat: duplicatedElement.view?._index,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { duplicatedElements };\n\t\t\t},\n\t\t\tundo: ( _: { elementIds: string[] }, { duplicatedElements }: DuplicatedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\t\t\t\t[ ...duplicatedElements ].reverse().forEach( ( { container } ) => {\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elementIds: string[] },\n\t\t\t\t{ duplicatedElements: previousElements }: DuplicatedElementsResult\n\t\t\t): DuplicatedElementsResult => {\n\t\t\t\tonDuplicateElements?.();\n\t\t\t\tconst duplicatedElements: DuplicatedElement[] = [];\n\n\t\t\t\tpreviousElements.forEach( ( { parentContainer, model, at } ) => {\n\t\t\t\t\tconst freshParent = parentContainer.lookup?.();\n\n\t\t\t\t\tif ( freshParent ) {\n\t\t\t\t\t\tconst createdElement = createElement( {\n\t\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\toptions: { useHistory: false, clone: false, at },\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tduplicatedElements.push( {\n\t\t\t\t\t\t\tcontainer: createdElement,\n\t\t\t\t\t\t\tparentContainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\tat,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\treturn { duplicatedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableDuplicate( { elementIds } );\n};\n","import { type ExtendedWindow } from './types';\n\nexport const generateElementId = () => {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn (\n\t\textendedWindow.elementorCommon?.helpers?.getUniqueId?.() ??\n\t\t`el-${ Date.now() }-${ Math.random().toString( 36 ).substring( 2, 9 ) }`\n\t);\n};\n","import { type ExtendedWindow } from './types';\n\nexport function getCurrentDocumentContainer() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.documents?.getCurrent?.()?.container ?? null;\n}\n","import { type ExtendedWindow } from './types';\n\nexport function getCurrentDocumentId() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.documents?.getCurrentId?.() ?? null;\n}\n","import { createError } from '@elementor/utils';\n\nexport const ElementNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_not_found',\n\tmessage: 'Element not found.',\n} );\n\nexport const StyleNotFoundError = createError< { styleId: string } >( {\n\tcode: 'style_not_found',\n\tmessage: 'Style not found.',\n} );\n\nexport const ElementTypeNotExistsError = createError< { elementId: string } >( {\n\tcode: 'element_type_not_exists',\n\tmessage: 'Element type does not exist.',\n} );\n\nexport const ElementLabelNotExistsError = createError< { elementType: string } >( {\n\tcode: 'element_label_not_exists',\n\tmessage: 'Element label does not exist.',\n} );\n\nexport const ElementParentNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_parent_not_found',\n\tmessage: 'Element parent not found.',\n} );\n\nexport const ElementIndexNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_index_not_found',\n\tmessage: 'Element index not found.',\n} );\n","import { ElementLabelNotExistsError, ElementTypeNotExistsError } from '../errors';\nimport { getContainer } from '../sync/get-container';\nimport { getWidgetsCache } from '../sync/get-widgets-cache';\nimport { type ElementID } from '../types';\nimport { getSelectedElements } from './get-selected-elements';\n\nexport function getElementLabel( elementId?: ElementID ) {\n\tif ( ! elementId ) {\n\t\telementId = getSelectedElements()?.[ 0 ]?.id;\n\t}\n\n\tconst container = getContainer( elementId );\n\n\tconst type = container?.model.get( 'widgetType' ) || container?.model.get( 'elType' );\n\n\tif ( ! type ) {\n\t\tthrow new ElementTypeNotExistsError( { context: { elementId } } );\n\t}\n\n\tconst label = getWidgetsCache()?.[ type ]?.title;\n\n\tif ( ! label ) {\n\t\tthrow new ElementLabelNotExistsError( { context: { elementType: type } } );\n\t}\n\n\treturn label;\n}\n","import { type StyleDefinition } from '@elementor/editor-styles';\n\nimport { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport const getElementStyles = ( elementID: ElementID ): Record< string, StyleDefinition > | null => {\n\tconst container = getContainer( elementID );\n\n\treturn container?.model.get( 'styles' ) || null;\n};\n","import { type V1Element } from './types';\n\nexport function getAllDescendants( container: V1Element ): V1Element[] {\n\tconst children = ( container.children ?? [] ).flatMap( ( child ) => getAllDescendants( child as V1Element ) );\n\n\treturn [ container, ...children ];\n}\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\nimport { getCurrentDocumentContainer } from './get-current-document-container';\nimport { type V1Element } from './types';\n\nexport function getElements( root?: ElementID ): V1Element[] {\n\tconst container = root ? getContainer( root ) : getCurrentDocumentContainer();\n\n\tif ( ! container ) {\n\t\treturn [];\n\t}\n\n\tconst children = [ ...( container.model.get( 'elements' ) ?? [] ) ].flatMap( ( childModel ) =>\n\t\tgetElements( childModel.get( 'id' ) )\n\t);\n\n\treturn [ container, ...children ];\n}\n","import { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tedit?: boolean;\n};\n\nexport type MoveElementParams = {\n\telement: V1Element;\n\ttargetContainer: V1Element;\n\toptions?: Options;\n};\n\nexport function moveElement( { element, targetContainer, options = {} }: MoveElementParams ): V1Element {\n\tconst resolvedElement = element.lookup?.();\n\tconst resolvedTarget = targetContainer.lookup?.();\n\n\tif ( ! resolvedElement ) {\n\t\tthrow new Error( `Element not found: ${ element.id }` );\n\t}\n\n\tif ( ! resolvedTarget ) {\n\t\tthrow new Error( `Target container not found: ${ targetContainer.id }` );\n\t}\n\n\tconst modelToRecreate = resolvedElement.model.toJSON();\n\n\tdeleteElement( {\n\t\tcontainer: resolvedElement,\n\t\toptions: { ...options, useHistory: false },\n\t} );\n\n\tconst newContainer = createElement( {\n\t\tcontainer: resolvedTarget,\n\t\tmodel: modelToRecreate,\n\t\toptions: { edit: false, ...options, useHistory: false },\n\t} );\n\n\treturn newContainer;\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { moveElement } from './move-element';\nimport { type V1Element } from './types';\n\ntype MoveOptions = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tedit?: boolean;\n};\n\ntype MoveInput = {\n\telement: V1Element;\n\ttargetContainer: V1Element;\n\toptions?: MoveOptions;\n};\n\ntype MoveElementsParams = {\n\tmoves: MoveInput[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonMoveElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype MovedElement = {\n\telement: V1Element;\n\toriginalContainer: V1Element;\n\toriginalIndex: number;\n\ttargetContainer: V1Element;\n\toptions?: MoveOptions;\n};\n\ntype MovedElementsResult = {\n\tmovedElements: MovedElement[];\n};\n\nexport type { MoveElementsParams, MoveInput, MovedElement, MovedElementsResult };\n\nexport const moveElements = ( {\n\tmoves: movesToMake,\n\ttitle,\n\tsubtitle = __( 'Elements moved', 'elementor' ),\n\tonMoveElements,\n\tonRestoreElements,\n}: MoveElementsParams ): MovedElementsResult => {\n\tconst undoableMove = undoable(\n\t\t{\n\t\t\tdo: ( { moves }: { moves: MoveInput[] } ): MovedElementsResult => {\n\t\t\t\tconst movedElements: MovedElement[] = [];\n\t\t\t\tonMoveElements?.();\n\n\t\t\t\tmoves.forEach( ( { element, targetContainer, options } ) => {\n\t\t\t\t\tconst sourceElement = element.lookup?.() ?? element;\n\t\t\t\t\tconst target = targetContainer.lookup?.() ?? targetContainer;\n\n\t\t\t\t\tif ( ! sourceElement ) {\n\t\t\t\t\t\tthrow new Error( 'Element not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! target ) {\n\t\t\t\t\t\tthrow new Error( 'Target container not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! sourceElement.parent ) {\n\t\t\t\t\t\tthrow new Error( 'Element has no parent container' );\n\t\t\t\t\t}\n\n\t\t\t\t\tconst originalContainer = sourceElement.parent;\n\t\t\t\t\tconst originalIndex = originalContainer.children?.indexOf( sourceElement ) ?? -1;\n\n\t\t\t\t\tconst newElement = moveElement( {\n\t\t\t\t\t\telement: sourceElement,\n\t\t\t\t\t\ttargetContainer: target,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tmovedElements.push( {\n\t\t\t\t\t\telement: newElement,\n\t\t\t\t\t\toriginalContainer,\n\t\t\t\t\t\toriginalIndex,\n\t\t\t\t\t\ttargetContainer: target,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { movedElements };\n\t\t\t},\n\t\t\tundo: ( _: { moves: MoveInput[] }, { movedElements }: MovedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\n\t\t\t\t[ ...movedElements ].reverse().forEach( ( { element, originalContainer, originalIndex } ) => {\n\t\t\t\t\tconst freshElement = element.lookup?.();\n\t\t\t\t\tconst freshOriginalContainer = originalContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshElement || ! freshOriginalContainer ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveElement( {\n\t\t\t\t\t\telement: freshElement,\n\t\t\t\t\t\ttargetContainer: freshOriginalContainer,\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tuseHistory: false,\n\t\t\t\t\t\t\tat: originalIndex >= 0 ? originalIndex : undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: ( _: { moves: MoveInput[] }, { movedElements }: MovedElementsResult ): MovedElementsResult => {\n\t\t\t\tconst newMovedElements: MovedElement[] = [];\n\t\t\t\tonMoveElements?.();\n\n\t\t\t\tmovedElements.forEach( ( { element, originalContainer, originalIndex, targetContainer, options } ) => {\n\t\t\t\t\tconst freshElement = element.lookup?.();\n\t\t\t\t\tconst freshOriginalContainer = originalContainer.lookup?.();\n\t\t\t\t\tconst freshTarget = targetContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshElement || ! freshOriginalContainer || ! freshTarget ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst newElement = moveElement( {\n\t\t\t\t\t\telement: freshElement,\n\t\t\t\t\t\ttargetContainer: freshTarget,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewMovedElements.push( {\n\t\t\t\t\t\telement: newElement,\n\t\t\t\t\t\toriginalContainer: freshOriginalContainer,\n\t\t\t\t\t\toriginalIndex,\n\t\t\t\t\t\ttargetContainer: freshTarget,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { movedElements: newMovedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableMove( { moves: movesToMake } );\n};\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype RemoveElementsParams = {\n\telementIds: string[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonRemoveElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype RemovedElement = {\n\tcontainer: V1Element;\n\tparent: V1Element;\n\tmodel: V1ElementModelProps;\n\tat: number;\n};\n\ntype RemovedElementsResult = {\n\tremovedElements: RemovedElement[];\n};\n\nexport const removeElements = ( {\n\telementIds,\n\ttitle,\n\tsubtitle = __( 'Item removed', 'elementor' ),\n\tonRemoveElements,\n\tonRestoreElements,\n}: RemoveElementsParams ): RemovedElementsResult => {\n\tconst undoableRemove = undoable(\n\t\t{\n\t\t\tdo: ( { elementIds: elementIdsParam }: { elementIds: string[] } ): RemovedElementsResult => {\n\t\t\t\tconst removedElements: RemovedElement[] = [];\n\n\t\t\t\telementIdsParam.forEach( ( elementId ) => {\n\t\t\t\t\tconst container = getContainer( elementId );\n\n\t\t\t\t\tif ( container?.parent ) {\n\t\t\t\t\t\tremovedElements.push( {\n\t\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\t\tparent: container.parent,\n\t\t\t\t\t\t\tmodel: container.model.toJSON(),\n\t\t\t\t\t\t\tat: container.view?._index ?? 0,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tonRemoveElements?.();\n\n\t\t\t\tremovedElements.forEach( ( { container } ) => {\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { removedElements };\n\t\t\t},\n\t\t\tundo: ( _: { elementIds: string[] }, { removedElements }: RemovedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\n\t\t\t\t[ ...removedElements ].reverse().forEach( ( { parent, model, at } ) => {\n\t\t\t\t\tconst freshParent = parent.lookup?.();\n\n\t\t\t\t\tif ( freshParent ) {\n\t\t\t\t\t\tcreateElement( {\n\t\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\toptions: { useHistory: false, at },\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elementIds: string[] },\n\t\t\t\t{ removedElements }: RemovedElementsResult\n\t\t\t): RemovedElementsResult => {\n\t\t\t\tonRemoveElements?.();\n\n\t\t\t\tconst newRemovedElements: RemovedElement[] = [];\n\n\t\t\t\tremovedElements.forEach( ( { container, parent, model, at } ) => {\n\t\t\t\t\tconst freshContainer = container.lookup?.();\n\t\t\t\t\tconst freshParent = parent.lookup?.();\n\n\t\t\t\t\tif ( ! freshContainer || ! freshParent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewRemovedElements.push( {\n\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\tparent: freshParent,\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\tat,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { removedElements: newRemovedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableRemove( { elementIds } );\n};\n","import { ElementIndexNotFoundError, ElementNotFoundError, ElementParentNotFoundError } from '../errors';\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementData, type V1ElementModelProps } from './types';\n\ntype ElementLocation = {\n\tcontainer: V1Element;\n\tindex: number;\n};\n\ntype ReplaceElementArgs = {\n\tcurrentElement: V1ElementData;\n\tnewElement: Omit< V1ElementModelProps, 'id' >;\n\twithHistory?: boolean;\n};\n\nexport const replaceElement = async ( { currentElement, newElement, withHistory = true }: ReplaceElementArgs ) => {\n\tconst currentElementContainer = getContainer( currentElement.id );\n\n\tif ( ! currentElementContainer ) {\n\t\tthrow new ElementNotFoundError( { context: { elementId: currentElement.id } } );\n\t}\n\n\tconst { container, index } = getNewElementContainer( currentElementContainer, newElement );\n\n\tconst newElementInstance = createElement( {\n\t\tcontainer,\n\t\tmodel: newElement,\n\t\toptions: { at: index, useHistory: withHistory },\n\t} );\n\n\tawait deleteElement( { container: currentElementContainer, options: { useHistory: withHistory } } );\n\n\treturn newElementInstance;\n};\n\nfunction getNewElementContainer(\n\tcurrentElementContainer: V1Element,\n\tnewElement: Omit< V1ElementModelProps, 'id' >\n): ElementLocation {\n\tconst { parent } = currentElementContainer;\n\n\tif ( ! parent ) {\n\t\tthrow new ElementParentNotFoundError( { context: { elementId: currentElementContainer.id } } );\n\t}\n\n\tconst elementIndex = currentElementContainer.view?._index ?? 0;\n\n\tif ( elementIndex === -1 ) {\n\t\tthrow new ElementIndexNotFoundError( { context: { elementId: currentElementContainer.id } } );\n\t}\n\n\tlet location: ElementLocation = { container: parent, index: elementIndex };\n\n\tif ( parent.id === 'document' && newElement.elType === 'widget' ) {\n\t\tlocation = createWrapperForWidget( parent, elementIndex );\n\t}\n\n\treturn location;\n}\n\nconst DEFAULT_CONTAINER_TYPE = 'e-flexbox';\n\nfunction createWrapperForWidget( parent: V1Element, elementIndex: number ): ElementLocation {\n\tconst container = createElement( {\n\t\tcontainer: parent,\n\t\tmodel: { elType: DEFAULT_CONTAINER_TYPE },\n\t\toptions: { at: elementIndex, useHistory: false },\n\t} );\n\n\treturn { container, index: 0 };\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1ElementModelProps } from '..';\nimport { getContainer } from './get-container';\n\nexport const updateElementEditorSettings = ( {\n\telementId,\n\tsettings,\n}: {\n\telementId: string;\n\tsettings: V1ElementModelProps[ 'editor_settings' ];\n} ) => {\n\tconst element = getContainer( elementId );\n\n\tif ( ! element ) {\n\t\tthrow new Error( `Element with id ${ elementId } not found` );\n\t}\n\n\tconst editorSettings = element.model.get( 'editor_settings' ) ?? {};\n\n\telement.model.set( 'editor_settings', { ...editorSettings, ...settings } );\n\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n};\n","import { type Props } from '@elementor/editor-props';\nimport { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport type UpdateElementSettingsArgs = {\n\tid: ElementID;\n\tprops: Props;\n\twithHistory?: boolean;\n};\n\nexport const updateElementSettings = ( { id, props, withHistory = true }: UpdateElementSettingsArgs ) => {\n\tconst container = getContainer( id );\n\n\tif ( ! container ) {\n\t\treturn;\n\t}\n\n\tconst args = {\n\t\tcontainer,\n\t\tsettings: { ...props },\n\t};\n\n\tif ( withHistory ) {\n\t\trunCommandSync( 'document/elements/settings', args );\n\t} else {\n\t\trunCommandSync( 'document/elements/set-settings', args, { internal: true } );\n\t}\n};\n","import { type LinkPropValue } from '@elementor/editor-props';\n\nimport { getContainer } from './sync/get-container';\nimport { getElementSetting } from './sync/get-element-setting';\n\nconst ANCHOR_SELECTOR = 'a, [data-action-link]';\n\ntype LinkValue = LinkPropValue[ 'value' ];\n\nexport type LinkInLinkRestriction =\n\t| {\n\t\t\tshouldRestrict: true;\n\t\t\treason: 'ancestor' | 'descendant';\n\t\t\telementId: string | null;\n\t }\n\t| {\n\t\t\tshouldRestrict: false;\n\t\t\treason?: never;\n\t\t\telementId?: never;\n\t };\n\nexport function getLinkInLinkRestriction( elementId: string, resolvedValue?: LinkValue ): LinkInLinkRestriction {\n\tconst anchoredDescendantId = getAnchoredDescendantId( elementId );\n\n\tif ( anchoredDescendantId ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'descendant',\n\t\t\telementId: anchoredDescendantId,\n\t\t};\n\t}\n\n\tconst hasInlineLink = checkForInlineLink( elementId, resolvedValue );\n\n\tif ( hasInlineLink ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'descendant',\n\t\t\telementId,\n\t\t};\n\t}\n\n\tconst ancestor = getAnchoredAncestorId( elementId );\n\n\tif ( ancestor ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'ancestor',\n\t\t\telementId: ancestor,\n\t\t};\n\t}\n\n\treturn {\n\t\tshouldRestrict: false,\n\t};\n}\n\nexport function getAnchoredDescendantId( elementId: string ): string | null {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element ) {\n\t\treturn null;\n\t}\n\n\tfor ( const childAnchorElement of Array.from( element.querySelectorAll( ANCHOR_SELECTOR ) ) ) {\n\t\t// Ensure the child is not in the current element's scope\n\t\tconst childElementId = findElementIdOf( childAnchorElement );\n\n\t\tif ( childElementId !== elementId ) {\n\t\t\treturn childElementId;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function getAnchoredAncestorId( elementId: string ): string | null {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element || element.parentElement === null ) {\n\t\treturn null;\n\t}\n\n\tconst parentAnchor = element.parentElement.closest( ANCHOR_SELECTOR );\n\n\treturn parentAnchor ? findElementIdOf( parentAnchor ) : null;\n}\n\nexport function isElementAnchored( elementId: string ): boolean {\n\tconst element = getElementDOM( elementId ) as HTMLElement;\n\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tif ( element.matches( ANCHOR_SELECTOR ) ) {\n\t\treturn true;\n\t}\n\n\treturn doesElementContainAnchor( element );\n}\n\nfunction doesElementContainAnchor( element: Element ): boolean {\n\tfor ( const child of Array.from( element.children ) as HTMLElement[] ) {\n\t\tif ( isElementorElement( child ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( child.matches( ANCHOR_SELECTOR ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( doesElementContainAnchor( child ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nfunction findElementIdOf( element: Element ): string | null {\n\treturn element.closest< HTMLElement >( '[data-id]' )?.dataset.id || null;\n}\n\nfunction checkForInlineLink( elementId: string, resolvedValue?: LinkValue ): boolean {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tif ( element.matches( ANCHOR_SELECTOR ) ) {\n\t\treturn false;\n\t}\n\n\tconst linkSetting = resolvedValue ?? getElementSetting< LinkPropValue >( elementId, 'link' )?.value;\n\n\tif ( linkSetting?.destination ) {\n\t\treturn false;\n\t}\n\n\treturn element.querySelector( ANCHOR_SELECTOR ) !== null;\n}\n\nfunction getElementDOM( id: string ) {\n\ttry {\n\t\treturn getContainer( id )?.view?.el || null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction isElementorElement( element: Element ): boolean {\n\treturn element.hasAttribute( 'data-id' );\n}\n","import { commandEndEvent, windowEvent } from '@elementor/editor-v1-adapters';\n\nexport const ELEMENT_STYLE_CHANGE_EVENT = 'elementor/editor-v2/editor-elements/style';\n\nexport const styleRerenderEvents = [\n\tcommandEndEvent( 'document/elements/create' ),\n\tcommandEndEvent( 'document/elements/duplicate' ),\n\tcommandEndEvent( 'document/elements/import' ),\n\tcommandEndEvent( 'document/elements/paste' ),\n\twindowEvent( ELEMENT_STYLE_CHANGE_EVENT ),\n];\n","import { classesPropTypeUtil } from '@elementor/editor-props';\nimport {\n\tgenerateId,\n\ttype StyleDefinition,\n\ttype StyleDefinitionID,\n\ttype StyleDefinitionVariant,\n} from '@elementor/editor-styles';\n\nimport { getElementSetting } from '../sync/get-element-setting';\nimport { updateElementSettings } from '../sync/update-element-settings';\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport type CreateElementStyleArgs = {\n\tstyleId?: StyleDefinitionID;\n\telementId: ElementID;\n\tclassesProp: string;\n\tlabel: string;\n\tmeta: StyleDefinitionVariant[ 'meta' ];\n\tprops: StyleDefinitionVariant[ 'props' ];\n\tcustom_css?: StyleDefinitionVariant[ 'custom_css' ];\n\tadditionalVariants?: StyleDefinitionVariant[];\n};\n\nexport function createElementStyle( {\n\tstyleId,\n\telementId,\n\tclassesProp,\n\tlabel,\n\tmeta,\n\tprops,\n\tcustom_css: customCss = null,\n\tadditionalVariants = [],\n}: CreateElementStyleArgs ): string {\n\tlet id = styleId;\n\n\tmutateElementStyles( elementId, ( styles ) => {\n\t\tid ??= generateId( `e-${ elementId }-`, Object.keys( styles ) );\n\n\t\tconst variants = [ { meta, props, custom_css: customCss }, ...additionalVariants ];\n\n\t\tstyles[ id ] = {\n\t\t\tid,\n\t\t\tlabel,\n\t\t\ttype: 'class',\n\t\t\tvariants,\n\t\t} satisfies StyleDefinition;\n\n\t\taddStyleToClassesProp( elementId, classesProp, id );\n\n\t\treturn styles;\n\t} );\n\n\treturn id as string;\n}\n\nfunction addStyleToClassesProp( elementId: ElementID, classesProp: string, styleId: string ) {\n\tconst base = getElementSetting( elementId, classesProp );\n\n\tconst classesPropValue = classesPropTypeUtil.create(\n\t\t( prev ) => {\n\t\t\treturn [ ...( prev ?? [] ), styleId ];\n\t\t},\n\t\t{ base }\n\t);\n\n\tupdateElementSettings( {\n\t\tid: elementId,\n\t\tprops: {\n\t\t\t[ classesProp ]: classesPropValue,\n\t\t},\n\t\twithHistory: false,\n\t} );\n}\n\nexport function shouldCreateNewLocalStyle< T >(\n\tpayload: { styleId: StyleDefinition[ 'id' ] | null; provider: T | null } | null\n) {\n\treturn ! payload?.styleId && ! payload?.provider;\n}\n","import { classesPropTypeUtil, type ClassesPropValue } from '@elementor/editor-props';\nimport { type StyleDefinition, type StyleDefinitionsMap } from '@elementor/editor-styles';\nimport { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { ElementNotFoundError } from '../errors';\nimport { getContainer } from '../sync/get-container';\nimport { type V1Element } from '../sync/types';\nimport { updateElementSettings } from '../sync/update-element-settings';\nimport { type ElementID } from '../types';\nimport { ELEMENT_STYLE_CHANGE_EVENT } from './consts';\n\ntype Mutator = ( styles: StyleDefinitionsMap ) => StyleDefinitionsMap;\n\nexport function mutateElementStyles( elementId: ElementID, mutator: Mutator ) {\n\tconst container = getContainer( elementId );\n\n\tif ( ! container ) {\n\t\tthrow new ElementNotFoundError( { context: { elementId } } );\n\t}\n\n\tconst oldIds = Object.keys( container.model.get( 'styles' ) ?? {} );\n\n\tconst styles = mutateStyles( container, mutator );\n\n\tconst newIds = Object.keys( styles );\n\n\tclearRemovedClasses( container, {\n\t\toldIds,\n\t\tnewIds,\n\t} );\n\n\tnotifyChanges();\n\n\treturn styles;\n}\n\nfunction mutateStyles( container: V1Element, mutator: Mutator ) {\n\tconst styles: StyleDefinitionsMap = structuredClone( container.model.get( 'styles' ) ) ?? {};\n\n\tconst entries = Object.entries( mutator( styles ) )\n\t\t.map( ( [ styleId, style ] ) => {\n\t\t\tstyle.variants = removeEmptyVariants( style );\n\n\t\t\treturn [ styleId, style ] as const;\n\t\t} )\n\t\t.filter( ( [ , style ] ) => {\n\t\t\treturn ! isStyleEmpty( style );\n\t\t} );\n\n\tconst mutatedStyles = Object.fromEntries( entries );\n\n\tcontainer.model.set( 'styles', mutatedStyles );\n\n\treturn mutatedStyles;\n}\n\nfunction removeEmptyVariants( style: StyleDefinition ) {\n\treturn style.variants.filter(\n\t\t( { props, custom_css: customCss } ) => Object.keys( props ).length > 0 || customCss?.raw\n\t);\n}\n\nfunction isStyleEmpty( style: StyleDefinition ) {\n\treturn style.variants.length === 0;\n}\n\nfunction clearRemovedClasses( container: V1Element, { oldIds, newIds }: { oldIds: string[]; newIds: string[] } ) {\n\tconst removedIds = oldIds.filter( ( id ) => ! newIds.includes( id ) );\n\tconst classesProps = structuredClone( getClassesProps( container ) );\n\n\tclassesProps.forEach( ( [ , prop ] ) => {\n\t\tprop.value = prop.value.filter( ( value ) => ! removedIds.includes( value ) );\n\t} );\n\n\tupdateElementSettings( {\n\t\tid: container.id,\n\t\tprops: Object.fromEntries( classesProps ),\n\t\twithHistory: false,\n\t} );\n}\n\nfunction getClassesProps( container: V1Element ) {\n\treturn Object.entries( container.settings.toJSON() ).filter( ( prop ): prop is [ string, ClassesPropValue ] => {\n\t\tconst [ , value ] = prop;\n\n\t\treturn classesPropTypeUtil.isValid( value );\n\t} );\n}\n\nfunction notifyChanges() {\n\tdispatchChangeEvent();\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n}\n\nfunction dispatchChangeEvent() {\n\twindow.dispatchEvent( new CustomEvent( ELEMENT_STYLE_CHANGE_EVENT ) );\n}\n","import { type StyleDefinitionID } from '@elementor/editor-styles';\n\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport function deleteElementStyle( elementId: ElementID, styleId: StyleDefinitionID ) {\n\tmutateElementStyles( elementId, ( styles ) => {\n\t\t// The object is deep cloned so mutating it is fine.\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete styles[ styleId ];\n\n\t\treturn styles;\n\t} );\n}\n","import { mergeProps } from '@elementor/editor-props';\nimport { getVariantByMeta, type StyleDefinition, type StyleDefinitionVariant } from '@elementor/editor-styles';\n\nimport { StyleNotFoundError } from '../errors';\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport type UpdateElementStyleArgs = {\n\telementId: ElementID;\n\tstyleId: StyleDefinition[ 'id' ];\n\tmeta: StyleDefinitionVariant[ 'meta' ];\n\tprops: StyleDefinitionVariant[ 'props' ];\n\tcustom_css?: StyleDefinitionVariant[ 'custom_css' ];\n};\n\nexport function updateElementStyle( args: UpdateElementStyleArgs ) {\n\tmutateElementStyles( args.elementId, ( styles ) => {\n\t\tconst style = styles[ args.styleId ];\n\n\t\tif ( ! style ) {\n\t\t\tthrow new StyleNotFoundError( { context: { styleId: args.styleId } } );\n\t\t}\n\n\t\tconst variant = getVariantByMeta( style, args.meta );\n\t\tconst customCss = ( 'custom_css' in args ? args.custom_css : variant?.custom_css ) ?? null;\n\n\t\tif ( variant ) {\n\t\t\tvariant.props = mergeProps( variant.props, args.props );\n\t\t\tvariant.custom_css = customCss?.raw ? customCss : null;\n\t\t} else {\n\t\t\tstyle.variants.push( { meta: args.meta, props: args.props, custom_css: customCss } );\n\t\t}\n\n\t\treturn styles;\n\t} );\n}\n","import { useState } from 'react';\nimport { __privateUseListenTo as useListenTo, windowEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementInteractions } from '../sync/get-element-interactions';\nimport { type ElementInteractions } from '../sync/types';\nimport { type ElementID } from '../types';\n\nexport const useElementInteractions = ( elementId: ElementID ) => {\n\tconst [ interactions, setInteractions ] = useState< ElementInteractions >( () => {\n\t\tconst initial = getElementInteractions( elementId );\n\n\t\treturn initial ?? { version: 1, items: [] };\n\t} );\n\n\tuseListenTo(\n\t\twindowEvent( 'elementor/element/update_interactions' ),\n\t\t() => {\n\t\t\tconst newInteractions = getElementInteractions( elementId );\n\t\t\tsetInteractions( newInteractions ?? { version: 1, items: [] } );\n\t\t},\n\t\t[ elementId ]\n\t);\n\n\treturn interactions;\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\nimport { type ElementInteractions } from './types';\n\nexport function getElementInteractions( elementId: ElementID ): ElementInteractions | undefined {\n\tconst container = getContainer( elementId );\n\n\tconst interactions = container?.model?.get( 'interactions' );\n\n\tif ( typeof interactions === 'string' ) {\n\t\treturn JSON.parse( interactions ) as ElementInteractions;\n\t}\n\n\treturn interactions;\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1ElementModelProps } from '..';\nimport { getContainer } from './get-container';\n\nexport const updateElementInteractions = ( {\n\telementId,\n\tinteractions,\n}: {\n\telementId: string;\n\tinteractions: V1ElementModelProps[ 'interactions' ];\n} ) => {\n\tconst element = getContainer( elementId );\n\n\tif ( ! element ) {\n\t\tthrow new Error( `Element with id ${ elementId } not found` );\n\t}\n\n\telement.model.set( 'interactions', interactions );\n\n\twindow.dispatchEvent( new CustomEvent( 'elementor/element/update_interactions' ) );\n\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n};\n\nexport const playElementInteractions = ( elementId: string, interactionId: string ) => {\n\twindow.top?.dispatchEvent(\n\t\tnew CustomEvent( 'atomic/play_interactions', { detail: { elementId, interactionId } } )\n\t);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,6BAAmF;;;ACAnF,gCAAkD;AAI3C,SAAS,aAAc,IAA+B;AAC5D,QAAM,iBAAiB;AACvB,QAAM,YAAY,eAAe,WAAW,eAAgB,EAAG;AAE/D,SAAO,a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ACG1D,SAAS,uBAAwB,WAAwD;AAC/F,QAAM,YAAY,aAAc,SAAU;AAE1C,QAAM,eAAe,WAAW,OAAO,IAAK,cAAe;AAE3D,MAAK,OAAO,iBAAiB,UAAW;AACvC,WAAO,KAAK,MAAO,YAAa;AAAA,EACjC;AAEA,SAAO;AACR;;;ADPO,IAAM,yBAAyB,CAAE,cAA0B;AACjE,QAAM,CAAE,cAAc,eAAgB,QAAI,uBAAiC,MAAM;AAChF,UAAM,UAAU,uBAAwB,SAAU;AAElD,WAAO,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC,EAAE;AAAA,EAC3C,CAAE;AAEF,kCAAAC;AAAA,QACC,yCAAa,uCAAwC;AAAA,IACrD,MAAM;AACL,YAAM,kBAAkB,uBAAwB,SAAU;AAC1D,sBAAiB,mBAAmB,EAAE,SAAS,GAAG,OAAO,CAAC,EAAE,CAAE;AAAA,IAC/D;AAAA,IACA,CAAE,SAAU;AAAA,EACb;AAEA,SAAO;AACR;;;AExBA,IAAAC,8BAA0D;AAKnD,IAAM,4BAA4B,CAAE;AAAA,EAC1C;AAAA,EACA;AACD,MAGO;AACN,QAAM,UAAU,aAAc,SAAU;AAExC,MAAK,CAAE,SAAU;AAChB,UAAM,IAAI,MAAO,mBAAoB,SAAU,YAAa;AAAA,EAC7D;AAEA,UAAQ,MAAM,IAAK,gBAAgB,YAAa;AAEhD,SAAO,cAAe,IAAI,YAAa,uCAAwC,CAAE;AAEjF,kCAAAC,yBAAgB,iCAAiC,EAAE,QAAQ,KAAK,GAAG,EAAE,UAAU,KAAK,CAAE;AACvF;AAEO,IAAM,0BAA0B,CAAE,WAAmB,kBAA2B;AACtF,SAAO,KAAK;AAAA,IACX,IAAI,YAAa,4BAA4B,EAAE,QAAQ,EAAE,WAAW,cAAc,EAAE,CAAE;AAAA,EACvF;AACD;","names":["import_editor_v1_adapters","runCommand","useListenTo","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","runCommandSync","import_editor_v1_adapters","import_editor_v1_adapters","runCommand","import_editor_v1_adapters","runCommandSync","import_editor_v1_adapters","runCommandSync","import_editor_v1_adapters","import_i18n","import_editor_v1_adapters","import_i18n","import_editor_v1_adapters","import_i18n","import_editor_v1_adapters","runCommandSync","import_editor_v1_adapters","runCommandSync","import_editor_v1_adapters","import_editor_props","import_editor_v1_adapters","runCommandSync","import_editor_props","import_editor_styles","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","runCommandSync"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/hooks/use-element-children.ts","../src/sync/get-container.ts","../src/sync/model-utils.ts","../src/hooks/use-element-editor-settings.ts","../src/sync/get-element-editor-settings.ts","../src/hooks/use-element-setting.ts","../src/sync/get-element-setting.ts","../src/hooks/use-parent-element.ts","../src/hooks/use-selected-element.ts","../src/sync/get-widgets-cache.ts","../src/sync/get-element-type.ts","../src/sync/get-selected-elements.ts","../src/sync/create-element.ts","../src/sync/create-elements.ts","../src/sync/delete-element.ts","../src/sync/drop-element.ts","../src/sync/duplicate-element.ts","../src/sync/duplicate-elements.ts","../src/sync/generate-element-id.ts","../src/sync/get-current-document-container.ts","../src/sync/get-current-document-id.ts","../src/errors.ts","../src/sync/get-element-label.ts","../src/sync/get-element-styles.ts","../src/sync/get-all-descendants.ts","../src/sync/get-elements.ts","../src/sync/move-element.ts","../src/sync/move-elements.ts","../src/sync/remove-elements.ts","../src/sync/replace-element.ts","../src/sync/update-element-editor-settings.ts","../src/sync/update-element-settings.ts","../src/link-restriction.ts","../src/styles/consts.ts","../src/styles/create-element-style.ts","../src/styles/mutate-element-styles.ts","../src/styles/delete-element-style.ts","../src/styles/update-element-style.ts","../src/hooks/use-element-interactions.ts","../src/sync/get-element-interactions.ts","../src/sync/update-element-interactions.ts"],"sourcesContent":["// types\nexport * from './types';\nexport type * from './sync/types';\n\n// hooks\nexport { useElementChildren, type ElementChildren, type ElementModel } from './hooks/use-element-children';\nexport { useElementEditorSettings } from './hooks/use-element-editor-settings';\nexport { useElementSetting, useElementSettings } from './hooks/use-element-setting';\nexport { useParentElement } from './hooks/use-parent-element';\nexport { useSelectedElement } from './hooks/use-selected-element';\n\n// utils\nexport { createElement, type CreateElementParams } from './sync/create-element';\nexport { createElements } from './sync/create-elements';\nexport { deleteElement } from './sync/delete-element';\nexport { dropElement, type DropElementParams } from './sync/drop-element';\nexport { duplicateElement, type DuplicateElementParams } from './sync/duplicate-element';\nexport {\n\tduplicateElements,\n\ttype DuplicatedElement,\n\ttype DuplicatedElementsResult,\n\ttype DuplicateElementsParams,\n} from './sync/duplicate-elements';\nexport { generateElementId } from './sync/generate-element-id';\nexport { getContainer, selectElement } from './sync/get-container';\nexport { getCurrentDocumentContainer } from './sync/get-current-document-container';\nexport { getCurrentDocumentId } from './sync/get-current-document-id';\nexport { getElementEditorSettings } from './sync/get-element-editor-settings';\nexport { getElementLabel } from './sync/get-element-label';\nexport { getElementSetting, getElementSettings } from './sync/get-element-setting';\nexport { getElementStyles } from './sync/get-element-styles';\nexport { getElementType } from './sync/get-element-type';\nexport { getAllDescendants } from './sync/get-all-descendants';\nexport {\n\tfindChildRecursive,\n\tgetElementChildren as getElementChildrenWithFallback,\n\ttype ModelResult,\n} from './sync/model-utils';\nexport { getElements } from './sync/get-elements';\nexport { getSelectedElements } from './sync/get-selected-elements';\nexport { getWidgetsCache } from './sync/get-widgets-cache';\nexport { moveElement, type MoveElementParams } from './sync/move-element';\nexport { moveElements } from './sync/move-elements';\nexport { removeElements } from './sync/remove-elements';\nexport { replaceElement } from './sync/replace-element';\nexport { updateElementEditorSettings } from './sync/update-element-editor-settings';\nexport { updateElementSettings, type UpdateElementSettingsArgs } from './sync/update-element-settings';\n\nexport {\n\tgetAnchoredAncestorId,\n\tgetAnchoredDescendantId,\n\tgetLinkInLinkRestriction,\n\tisElementAnchored,\n\ttype LinkInLinkRestriction,\n} from './link-restriction';\nexport { ELEMENT_STYLE_CHANGE_EVENT, styleRerenderEvents } from './styles/consts';\nexport {\n\tcreateElementStyle,\n\tshouldCreateNewLocalStyle,\n\ttype CreateElementStyleArgs,\n} from './styles/create-element-style';\nexport { deleteElementStyle } from './styles/delete-element-style';\nexport { updateElementStyle, type UpdateElementStyleArgs } from './styles/update-element-style';\n\nexport { useElementInteractions } from './hooks/use-element-interactions';\nexport { getElementInteractions } from './sync/get-element-interactions';\nexport { playElementInteractions, updateElementInteractions } from './sync/update-element-interactions';\n","import { __privateUseListenTo as useListenTo, commandEndEvent, v1ReadyEvent } from '@elementor/editor-v1-adapters';\n\nimport { getContainer } from '../sync/get-container';\nimport { findChildRecursive, getElementChildren, type ModelResult } from '../sync/model-utils';\nimport { type V1ElementEditorSettingsProps } from '../sync/types';\nimport { type ElementID } from '../types';\n\nexport type ElementModel = {\n\tid: string;\n\teditorSettings: V1ElementEditorSettingsProps;\n};\n\nexport type ElementChildren = Record< string, ElementModel[] >;\n\nfunction toElementModel( { model }: ModelResult ): ElementModel {\n\treturn {\n\t\tid: model.get( 'id' ) as string,\n\t\teditorSettings: model.get( 'editor_settings' ) ?? {},\n\t};\n}\n\nexport function useElementChildren< T extends ElementChildren >(\n\telementId: ElementID,\n\tchildrenTypes: Record< string, string >\n): T {\n\treturn useListenTo(\n\t\t[\n\t\t\tv1ReadyEvent(),\n\t\t\tcommandEndEvent( 'document/elements/create' ),\n\t\t\tcommandEndEvent( 'document/elements/delete' ),\n\t\t\tcommandEndEvent( 'document/elements/update' ),\n\t\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t],\n\t\t() => {\n\t\t\tconst container = getContainer( elementId );\n\t\t\tconst model = container?.model;\n\n\t\t\tif ( ! model ) {\n\t\t\t\treturn {} as ElementChildren;\n\t\t\t}\n\n\t\t\tconst elementChildren = Object.entries( childrenTypes ).reduce( ( acc, [ parentType, childType ] ) => {\n\t\t\t\tconst parent = findChildRecursive( model, ( m ) => m.get( 'elType' ) === parentType );\n\n\t\t\t\tif ( ! parent ) {\n\t\t\t\t\tacc[ childType ] = [];\n\t\t\t\t\treturn acc;\n\t\t\t\t}\n\n\t\t\t\tconst children = getElementChildren( parent.model, ( m ) => m.get( 'elType' ) === childType );\n\n\t\t\t\tacc[ childType ] = children.map( toElementModel );\n\n\t\t\t\treturn acc;\n\t\t\t}, {} as ElementChildren );\n\n\t\t\treturn elementChildren;\n\t\t},\n\t\t[ elementId ]\n\t) as T;\n}\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\n\nimport { type ExtendedWindow, type V1Element } from './types';\n\nexport function getContainer( id: string ): V1Element | null {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\tconst container = extendedWindow.elementor?.getContainer?.( id );\n\n\treturn container ?? null;\n}\n\nexport const selectElement = ( elementId: string ) => {\n\ttry {\n\t\tconst container = getContainer( elementId );\n\n\t\trunCommand( 'document/elements/select', { container } );\n\t} catch {}\n};\n","import { type V1Element } from './types';\n\nexport type V1Model = V1Element[ 'model' ];\n\nexport type V1Collection = V1Model[] & {\n\tremove: ( model: V1Model ) => void;\n\tadd: ( model: V1Model, options?: { at?: number }, silent?: boolean ) => void;\n\tindexOf: ( model: V1Model ) => number;\n};\n\nexport type ModelResult = {\n\tmodel: V1Model;\n};\n\nexport function findChildRecursive( model: V1Model, predicate: ( model: V1Model ) => boolean ): ModelResult | null {\n\tconst childModels = ( model.get( 'elements' ) ?? [] ) as V1Model[];\n\n\tfor ( const childModel of childModels ) {\n\t\tif ( predicate( childModel ) ) {\n\t\t\treturn { model: childModel };\n\t\t}\n\n\t\tconst found = findChildRecursive( childModel, predicate );\n\n\t\tif ( found ) {\n\t\t\treturn found;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function getElementChildren( model: V1Model, predicate?: ( model: V1Model ) => boolean ): ModelResult[] {\n\tconst childModels = ( model.get( 'elements' ) ?? [] ) as V1Model[];\n\n\treturn childModels\n\t\t.filter( ( childModel ) => ! predicate || predicate( childModel ) )\n\t\t.map( ( childModel ) => ( { model: childModel } ) );\n}\n","import { __privateUseListenTo as useListenTo, windowEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementEditorSettings } from '../sync/get-element-editor-settings';\nimport { type ElementID } from '../types';\n\nexport const useElementEditorSettings = ( elementId: ElementID ) => {\n\treturn useListenTo(\n\t\twindowEvent( 'elementor/element/update_editor_settings' ),\n\t\t() => getElementEditorSettings( elementId ),\n\t\t[ elementId ]\n\t);\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport function getElementEditorSettings( elementId: ElementID ) {\n\tconst container = getContainer( elementId );\n\n\treturn container?.model.get( 'editor_settings' ) ?? {};\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementSetting } from '../sync/get-element-setting';\nimport { type ElementID } from '../types';\n\nexport const useElementSetting = < TValue >( elementId: ElementID, settingKey: string ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t() => getElementSetting< TValue >( elementId, settingKey ),\n\t\t[ elementId, settingKey ]\n\t);\n};\n\nexport const useElementSettings = < TValue >( elementId: ElementID, settingKeys: string[] ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t() =>\n\t\t\tsettingKeys.reduce< Record< string, TValue > >( ( settings, key ) => {\n\t\t\t\tconst value = getElementSetting< TValue >( elementId, key );\n\n\t\t\t\tif ( value !== null ) {\n\t\t\t\t\tsettings[ key ] = value;\n\t\t\t\t}\n\n\t\t\t\treturn settings;\n\t\t\t}, {} ),\n\t\t[ elementId, settingKeys.join( ',' ) ]\n\t);\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport const getElementSetting = < TValue >( elementId: ElementID, settingKey: string ): TValue | null => {\n\tconst container = getContainer( elementId );\n\n\treturn ( container?.settings?.get( settingKey ) as TValue ) ?? null;\n};\n\nexport const getElementSettings = < TValue >(\n\telementId: ElementID,\n\tsettingKey: string[]\n): Record< string, TValue | null > => {\n\treturn Object.fromEntries( settingKey.map( ( key ) => [ key, getElementSetting( elementId, key ) ] ) );\n};\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { type ExtendedWindow } from '../sync/types';\n\nexport function useParentElement( elementId: string | null ) {\n\treturn useListenTo(\n\t\t[ commandEndEvent( 'document/elements/create' ) ],\n\t\t() => {\n\t\t\tif ( ! elementId ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst extendedWindow = window as unknown as ExtendedWindow;\n\t\t\tconst element = extendedWindow?.elementor?.getContainer?.( elementId );\n\t\t\tif ( ! element ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn element.parent;\n\t\t},\n\t\t[ elementId ]\n\t);\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementType } from '../sync/get-element-type';\nimport { getSelectedElements } from '../sync/get-selected-elements';\n\nexport function useSelectedElement() {\n\tconst elements = useListenTo(\n\t\t[\n\t\t\tcommandEndEvent( 'document/elements/select' ),\n\t\t\tcommandEndEvent( 'document/elements/deselect' ),\n\t\t\tcommandEndEvent( 'document/elements/select-all' ),\n\t\t\tcommandEndEvent( 'document/elements/deselect-all' ),\n\t\t],\n\t\tgetSelectedElements\n\t);\n\n\tconst [ element ] = elements;\n\n\tconst elementType = getElementType( element?.type );\n\n\tif ( elements.length !== 1 || ! elementType ) {\n\t\treturn { element: null, elementType: null };\n\t}\n\n\treturn { element, elementType };\n}\n","import { type ExtendedWindow, type V1ElementConfig } from '../sync/types.js';\ntype WidgetsCache< T > = Record< string, T >;\n\nexport function getWidgetsCache< T extends V1ElementConfig >(): WidgetsCache< T > | null {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn ( extendedWindow?.elementor?.widgetsCache as WidgetsCache< T > ) || null;\n}\n","import { type ElementType } from '../types';\nimport { getWidgetsCache } from './get-widgets-cache';\n\nexport function getElementType( type: string ): ElementType | null {\n\tif ( ! type ) {\n\t\treturn null;\n\t}\n\n\tconst widgetsCache = getWidgetsCache();\n\tconst elementType = widgetsCache?.[ type ];\n\n\tif ( ! elementType?.atomic_controls ) {\n\t\treturn null;\n\t}\n\n\tif ( ! elementType?.atomic_props_schema ) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tkey: type,\n\t\tcontrols: elementType.atomic_controls,\n\t\tpropsSchema: elementType.atomic_props_schema,\n\t\tdependenciesPerTargetMapping: elementType.dependencies_per_target_mapping ?? {},\n\t\ttitle: elementType.title,\n\t\tstyleStates: elementType.atomic_style_states ?? [],\n\t\tpseudoStates: elementType.atomic_pseudo_states ?? [],\n\t};\n}\n","import { type Element } from '../types';\nimport { type ExtendedWindow } from './types';\n\nexport function getSelectedElements(): Element[] {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\tconst selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];\n\n\treturn selectedElements.reduce< Element[] >( ( acc, el ) => {\n\t\tconst type = el.model.get( 'widgetType' ) || el.model.get( 'elType' );\n\n\t\tif ( type ) {\n\t\t\tacc.push( {\n\t\t\t\tid: el.model.get( 'id' ),\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\n\t\treturn acc;\n\t}, [] );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element, type V1ElementModelProps, type V1ElementSettingsProps } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tclone?: boolean;\n};\n\nexport type CreateElementParams = {\n\tcontainer: V1Element;\n\tmodel?: Omit< V1ElementModelProps, 'settings' | 'id' > & { settings?: V1ElementSettingsProps; id?: string };\n\toptions?: Options;\n};\n\nexport function createElement( { container, model, options }: CreateElementParams ): V1Element {\n\treturn runCommandSync< V1Element >( 'document/elements/create', {\n\t\tcontainer,\n\t\tmodel,\n\t\toptions: { edit: false, ...options },\n\t} );\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement, type CreateElementParams } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype CreateElementsParams = {\n\telements: CreateElementParams[];\n\ttitle: string;\n\tsubtitle?: string;\n};\n\ntype CreatedElement = {\n\tcontainer: V1Element;\n\tparentContainer: V1Element;\n\tmodel: V1ElementModelProps;\n\toptions?: CreateElementParams[ 'options' ];\n};\n\ntype CreatedElementsResult = {\n\tcreatedElements: CreatedElement[];\n};\n\nexport type { CreateElementsParams, CreatedElement, CreatedElementsResult };\n\nexport const createElements = ( {\n\telements,\n\ttitle,\n\tsubtitle = __( 'Item added', 'elementor' ),\n}: CreateElementsParams ): CreatedElementsResult => {\n\tconst undoableCreate = undoable(\n\t\t{\n\t\t\tdo: ( { elements: elementsParam }: { elements: CreateElementParams[] } ): CreatedElementsResult => {\n\t\t\t\tconst createdElements: CreatedElement[] = [];\n\n\t\t\t\telementsParam.forEach( ( { container, options, ...elementParams } ) => {\n\t\t\t\t\tconst parentContainer = container.lookup?.() ?? container;\n\n\t\t\t\t\tif ( ! parentContainer ) {\n\t\t\t\t\t\tthrow new Error( 'Parent container not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tconst element = createElement( {\n\t\t\t\t\t\tcontainer: parentContainer,\n\t\t\t\t\t\t...elementParams,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tcreatedElements.push( {\n\t\t\t\t\t\tcontainer: element,\n\t\t\t\t\t\tparentContainer,\n\t\t\t\t\t\tmodel: element.model?.toJSON() || {},\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { createdElements };\n\t\t\t},\n\t\t\tundo: ( _: { elements: CreateElementParams[] }, { createdElements }: CreatedElementsResult ) => {\n\t\t\t\t[ ...createdElements ].reverse().forEach( ( { container } ) => {\n\t\t\t\t\tconst freshContainer = container.lookup?.();\n\n\t\t\t\t\tif ( freshContainer ) {\n\t\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elements: CreateElementParams[] },\n\t\t\t\t{ createdElements }: CreatedElementsResult\n\t\t\t): CreatedElementsResult => {\n\t\t\t\tconst newElements: CreatedElement[] = [];\n\n\t\t\t\tcreatedElements.forEach( ( { parentContainer, model, options } ) => {\n\t\t\t\t\tconst freshParent = parentContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshParent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst element = createElement( {\n\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewElements.push( {\n\t\t\t\t\t\tcontainer: element,\n\t\t\t\t\t\tparentContainer: freshParent,\n\t\t\t\t\t\tmodel: element.model.toJSON(),\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { createdElements: newElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableCreate( { elements } );\n};\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n};\n\ntype DeleteElementParams = {\n\tcontainer: V1Element;\n\toptions?: Options;\n};\n\nexport function deleteElement( { container, options = {} }: DeleteElementParams ): Promise< void > {\n\treturn runCommand( 'document/elements/delete', {\n\t\tcontainer,\n\t\toptions,\n\t} );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps, type V1ElementSettingsProps } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tscrollIntoView: boolean;\n};\n\nexport type DropElementParams = {\n\tcontainerId: string;\n\toptions?: Options;\n\tmodel?: Omit< V1ElementModelProps, 'settings' | 'id' > & { settings?: V1ElementSettingsProps; id?: string };\n};\n\nexport function dropElement( { containerId, model, options }: DropElementParams ) {\n\tconst container = getContainer( containerId );\n\n\tif ( ! container ) {\n\t\tthrow new Error( `Container with ID \"${ containerId }\" not found` );\n\t}\n\n\treturn runCommandSync< V1Element >( 'preview/drop', {\n\t\tcontainer,\n\t\tmodel,\n\t\toptions,\n\t} );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tclone?: boolean;\n};\n\nexport type DuplicateElementParams = {\n\telement: V1Element;\n\toptions?: Options;\n};\n\nexport function duplicateElement( { element, options = {} }: DuplicateElementParams ): V1Element {\n\tconst currentIndex = element.view?._index ?? 0;\n\tconst insertPosition = options.clone !== false ? currentIndex + 1 : undefined;\n\n\treturn runCommandSync< V1Element >( 'document/elements/duplicate', {\n\t\tcontainer: element,\n\t\toptions: { at: insertPosition, edit: false, ...options },\n\t} );\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { duplicateElement } from './duplicate-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype DuplicateElementsParams = {\n\telementIds: string[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonDuplicateElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype DuplicatedElement = {\n\tcontainer: V1Element;\n\tparentContainer: V1Element;\n\tmodel: V1ElementModelProps;\n\tat?: number;\n};\n\ntype DuplicatedElementsResult = {\n\tduplicatedElements: DuplicatedElement[];\n};\n\nexport type { DuplicateElementsParams, DuplicatedElement, DuplicatedElementsResult };\n\nexport const duplicateElements = ( {\n\telementIds,\n\ttitle,\n\tsubtitle = __( 'Item duplicated', 'elementor' ),\n\tonDuplicateElements,\n\tonRestoreElements,\n}: DuplicateElementsParams ): DuplicatedElementsResult => {\n\tconst undoableDuplicate = undoable(\n\t\t{\n\t\t\tdo: ( { elementIds: elementIdsToDuplicate }: { elementIds: string[] } ): DuplicatedElementsResult => {\n\t\t\t\tonDuplicateElements?.();\n\t\t\t\tconst duplicatedElements: DuplicatedElement[] = [];\n\n\t\t\t\telementIdsToDuplicate.forEach( ( elementId ) => {\n\t\t\t\t\tconst originalContainer = getContainer( elementId );\n\n\t\t\t\t\tif ( ! originalContainer?.parent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst duplicatedElement = duplicateElement( {\n\t\t\t\t\t\telement: originalContainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( ! duplicatedElement.parent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tduplicatedElements.push( {\n\t\t\t\t\t\tcontainer: duplicatedElement,\n\t\t\t\t\t\tparentContainer: duplicatedElement.parent,\n\t\t\t\t\t\tmodel: duplicatedElement.model.toJSON(),\n\t\t\t\t\t\tat: duplicatedElement.view?._index,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { duplicatedElements };\n\t\t\t},\n\t\t\tundo: ( _: { elementIds: string[] }, { duplicatedElements }: DuplicatedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\t\t\t\t[ ...duplicatedElements ].reverse().forEach( ( { container } ) => {\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elementIds: string[] },\n\t\t\t\t{ duplicatedElements: previousElements }: DuplicatedElementsResult\n\t\t\t): DuplicatedElementsResult => {\n\t\t\t\tonDuplicateElements?.();\n\t\t\t\tconst duplicatedElements: DuplicatedElement[] = [];\n\n\t\t\t\tpreviousElements.forEach( ( { parentContainer, model, at } ) => {\n\t\t\t\t\tconst freshParent = parentContainer.lookup?.();\n\n\t\t\t\t\tif ( freshParent ) {\n\t\t\t\t\t\tconst createdElement = createElement( {\n\t\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\toptions: { useHistory: false, clone: false, at },\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tduplicatedElements.push( {\n\t\t\t\t\t\t\tcontainer: createdElement,\n\t\t\t\t\t\t\tparentContainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\tat,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\treturn { duplicatedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableDuplicate( { elementIds } );\n};\n","import { type ExtendedWindow } from './types';\n\nexport const generateElementId = () => {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn (\n\t\textendedWindow.elementorCommon?.helpers?.getUniqueId?.() ??\n\t\t`el-${ Date.now() }-${ Math.random().toString( 36 ).substring( 2, 9 ) }`\n\t);\n};\n","import { type ExtendedWindow } from './types';\n\nexport function getCurrentDocumentContainer() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.documents?.getCurrent?.()?.container ?? null;\n}\n","import { type ExtendedWindow } from './types';\n\nexport function getCurrentDocumentId() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.documents?.getCurrentId?.() ?? null;\n}\n","import { createError } from '@elementor/utils';\n\nexport const ElementNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_not_found',\n\tmessage: 'Element not found.',\n} );\n\nexport const StyleNotFoundError = createError< { styleId: string } >( {\n\tcode: 'style_not_found',\n\tmessage: 'Style not found.',\n} );\n\nexport const ElementTypeNotExistsError = createError< { elementId: string } >( {\n\tcode: 'element_type_not_exists',\n\tmessage: 'Element type does not exist.',\n} );\n\nexport const ElementLabelNotExistsError = createError< { elementType: string } >( {\n\tcode: 'element_label_not_exists',\n\tmessage: 'Element label does not exist.',\n} );\n\nexport const ElementParentNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_parent_not_found',\n\tmessage: 'Element parent not found.',\n} );\n\nexport const ElementIndexNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_index_not_found',\n\tmessage: 'Element index not found.',\n} );\n","import { ElementLabelNotExistsError, ElementTypeNotExistsError } from '../errors';\nimport { getContainer } from '../sync/get-container';\nimport { getWidgetsCache } from '../sync/get-widgets-cache';\nimport { type ElementID } from '../types';\nimport { getSelectedElements } from './get-selected-elements';\n\nexport function getElementLabel( elementId?: ElementID ) {\n\tif ( ! elementId ) {\n\t\telementId = getSelectedElements()?.[ 0 ]?.id;\n\t}\n\n\tconst container = getContainer( elementId );\n\n\tconst type = container?.model.get( 'widgetType' ) || container?.model.get( 'elType' );\n\n\tif ( ! type ) {\n\t\tthrow new ElementTypeNotExistsError( { context: { elementId } } );\n\t}\n\n\tconst label = getWidgetsCache()?.[ type ]?.title;\n\n\tif ( ! label ) {\n\t\tthrow new ElementLabelNotExistsError( { context: { elementType: type } } );\n\t}\n\n\treturn label;\n}\n","import { type StyleDefinition } from '@elementor/editor-styles';\n\nimport { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport const getElementStyles = ( elementID: ElementID ): Record< string, StyleDefinition > | null => {\n\tconst container = getContainer( elementID );\n\n\treturn container?.model.get( 'styles' ) || null;\n};\n","import { type V1Element } from './types';\n\nexport function getAllDescendants( container: V1Element ): V1Element[] {\n\tconst children = ( container.children ?? [] ).flatMap( ( child ) => getAllDescendants( child as V1Element ) );\n\n\treturn [ container, ...children ];\n}\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\nimport { getCurrentDocumentContainer } from './get-current-document-container';\nimport { type V1Element } from './types';\n\nexport function getElements( root?: ElementID ): V1Element[] {\n\tconst container = root ? getContainer( root ) : getCurrentDocumentContainer();\n\n\tif ( ! container ) {\n\t\treturn [];\n\t}\n\n\tconst children = [ ...( container.model.get( 'elements' ) ?? [] ) ].flatMap( ( childModel ) =>\n\t\tgetElements( childModel.get( 'id' ) )\n\t);\n\n\treturn [ container, ...children ];\n}\n","import { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tedit?: boolean;\n};\n\nexport type MoveElementParams = {\n\telement: V1Element;\n\ttargetContainer: V1Element;\n\toptions?: Options;\n};\n\nexport function moveElement( { element, targetContainer, options = {} }: MoveElementParams ): V1Element {\n\tconst resolvedElement = element.lookup?.();\n\tconst resolvedTarget = targetContainer.lookup?.();\n\n\tif ( ! resolvedElement ) {\n\t\tthrow new Error( `Element not found: ${ element.id }` );\n\t}\n\n\tif ( ! resolvedTarget ) {\n\t\tthrow new Error( `Target container not found: ${ targetContainer.id }` );\n\t}\n\n\tconst modelToRecreate = resolvedElement.model.toJSON();\n\n\tdeleteElement( {\n\t\tcontainer: resolvedElement,\n\t\toptions: { ...options, useHistory: false },\n\t} );\n\n\tconst newContainer = createElement( {\n\t\tcontainer: resolvedTarget,\n\t\tmodel: modelToRecreate,\n\t\toptions: { edit: false, ...options, useHistory: false },\n\t} );\n\n\treturn newContainer;\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { moveElement } from './move-element';\nimport { type V1Element } from './types';\n\ntype MoveOptions = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tedit?: boolean;\n};\n\ntype MoveInput = {\n\telement: V1Element;\n\ttargetContainer: V1Element;\n\toptions?: MoveOptions;\n};\n\ntype MoveElementsParams = {\n\tmoves: MoveInput[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonMoveElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype MovedElement = {\n\telement: V1Element;\n\toriginalContainer: V1Element;\n\toriginalIndex: number;\n\ttargetContainer: V1Element;\n\toptions?: MoveOptions;\n};\n\ntype MovedElementsResult = {\n\tmovedElements: MovedElement[];\n};\n\nexport type { MoveElementsParams, MoveInput, MovedElement, MovedElementsResult };\n\nexport const moveElements = ( {\n\tmoves: movesToMake,\n\ttitle,\n\tsubtitle = __( 'Elements moved', 'elementor' ),\n\tonMoveElements,\n\tonRestoreElements,\n}: MoveElementsParams ): MovedElementsResult => {\n\tconst undoableMove = undoable(\n\t\t{\n\t\t\tdo: ( { moves }: { moves: MoveInput[] } ): MovedElementsResult => {\n\t\t\t\tconst movedElements: MovedElement[] = [];\n\t\t\t\tonMoveElements?.();\n\n\t\t\t\tmoves.forEach( ( { element, targetContainer, options } ) => {\n\t\t\t\t\tconst sourceElement = element.lookup?.() ?? element;\n\t\t\t\t\tconst target = targetContainer.lookup?.() ?? targetContainer;\n\n\t\t\t\t\tif ( ! sourceElement ) {\n\t\t\t\t\t\tthrow new Error( 'Element not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! target ) {\n\t\t\t\t\t\tthrow new Error( 'Target container not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! sourceElement.parent ) {\n\t\t\t\t\t\tthrow new Error( 'Element has no parent container' );\n\t\t\t\t\t}\n\n\t\t\t\t\tconst originalContainer = sourceElement.parent;\n\t\t\t\t\tconst originalIndex = originalContainer.children?.indexOf( sourceElement ) ?? -1;\n\n\t\t\t\t\tconst newElement = moveElement( {\n\t\t\t\t\t\telement: sourceElement,\n\t\t\t\t\t\ttargetContainer: target,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tmovedElements.push( {\n\t\t\t\t\t\telement: newElement,\n\t\t\t\t\t\toriginalContainer,\n\t\t\t\t\t\toriginalIndex,\n\t\t\t\t\t\ttargetContainer: target,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { movedElements };\n\t\t\t},\n\t\t\tundo: ( _: { moves: MoveInput[] }, { movedElements }: MovedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\n\t\t\t\t[ ...movedElements ].reverse().forEach( ( { element, originalContainer, originalIndex } ) => {\n\t\t\t\t\tconst freshElement = element.lookup?.();\n\t\t\t\t\tconst freshOriginalContainer = originalContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshElement || ! freshOriginalContainer ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveElement( {\n\t\t\t\t\t\telement: freshElement,\n\t\t\t\t\t\ttargetContainer: freshOriginalContainer,\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tuseHistory: false,\n\t\t\t\t\t\t\tat: originalIndex >= 0 ? originalIndex : undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: ( _: { moves: MoveInput[] }, { movedElements }: MovedElementsResult ): MovedElementsResult => {\n\t\t\t\tconst newMovedElements: MovedElement[] = [];\n\t\t\t\tonMoveElements?.();\n\n\t\t\t\tmovedElements.forEach( ( { element, originalContainer, originalIndex, targetContainer, options } ) => {\n\t\t\t\t\tconst freshElement = element.lookup?.();\n\t\t\t\t\tconst freshOriginalContainer = originalContainer.lookup?.();\n\t\t\t\t\tconst freshTarget = targetContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshElement || ! freshOriginalContainer || ! freshTarget ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst newElement = moveElement( {\n\t\t\t\t\t\telement: freshElement,\n\t\t\t\t\t\ttargetContainer: freshTarget,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewMovedElements.push( {\n\t\t\t\t\t\telement: newElement,\n\t\t\t\t\t\toriginalContainer: freshOriginalContainer,\n\t\t\t\t\t\toriginalIndex,\n\t\t\t\t\t\ttargetContainer: freshTarget,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { movedElements: newMovedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableMove( { moves: movesToMake } );\n};\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype RemoveElementsParams = {\n\telementIds: string[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonRemoveElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype RemovedElement = {\n\tcontainer: V1Element;\n\tparent: V1Element;\n\tmodel: V1ElementModelProps;\n\tat: number;\n};\n\ntype RemovedElementsResult = {\n\tremovedElements: RemovedElement[];\n};\n\nexport const removeElements = ( {\n\telementIds,\n\ttitle,\n\tsubtitle = __( 'Item removed', 'elementor' ),\n\tonRemoveElements,\n\tonRestoreElements,\n}: RemoveElementsParams ): RemovedElementsResult => {\n\tconst undoableRemove = undoable(\n\t\t{\n\t\t\tdo: ( { elementIds: elementIdsParam }: { elementIds: string[] } ): RemovedElementsResult => {\n\t\t\t\tconst removedElements: RemovedElement[] = [];\n\n\t\t\t\telementIdsParam.forEach( ( elementId ) => {\n\t\t\t\t\tconst container = getContainer( elementId );\n\n\t\t\t\t\tif ( container?.parent ) {\n\t\t\t\t\t\tremovedElements.push( {\n\t\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\t\tparent: container.parent,\n\t\t\t\t\t\t\tmodel: container.model.toJSON(),\n\t\t\t\t\t\t\tat: container.view?._index ?? 0,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tonRemoveElements?.();\n\n\t\t\t\tremovedElements.forEach( ( { container } ) => {\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { removedElements };\n\t\t\t},\n\t\t\tundo: ( _: { elementIds: string[] }, { removedElements }: RemovedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\n\t\t\t\t[ ...removedElements ].reverse().forEach( ( { parent, model, at } ) => {\n\t\t\t\t\tconst freshParent = parent.lookup?.();\n\n\t\t\t\t\tif ( freshParent ) {\n\t\t\t\t\t\tcreateElement( {\n\t\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\toptions: { useHistory: false, at },\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elementIds: string[] },\n\t\t\t\t{ removedElements }: RemovedElementsResult\n\t\t\t): RemovedElementsResult => {\n\t\t\t\tonRemoveElements?.();\n\n\t\t\t\tconst newRemovedElements: RemovedElement[] = [];\n\n\t\t\t\tremovedElements.forEach( ( { container, parent, model, at } ) => {\n\t\t\t\t\tconst freshContainer = container.lookup?.();\n\t\t\t\t\tconst freshParent = parent.lookup?.();\n\n\t\t\t\t\tif ( ! freshContainer || ! freshParent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewRemovedElements.push( {\n\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\tparent: freshParent,\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\tat,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { removedElements: newRemovedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableRemove( { elementIds } );\n};\n","import { ElementIndexNotFoundError, ElementNotFoundError, ElementParentNotFoundError } from '../errors';\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementData, type V1ElementModelProps } from './types';\n\ntype ElementLocation = {\n\tcontainer: V1Element;\n\tindex: number;\n};\n\ntype ReplaceElementArgs = {\n\tcurrentElement: V1ElementData;\n\tnewElement: Omit< V1ElementModelProps, 'id' >;\n\twithHistory?: boolean;\n};\n\nexport const replaceElement = async ( { currentElement, newElement, withHistory = true }: ReplaceElementArgs ) => {\n\tconst currentElementContainer = getContainer( currentElement.id );\n\n\tif ( ! currentElementContainer ) {\n\t\tthrow new ElementNotFoundError( { context: { elementId: currentElement.id } } );\n\t}\n\n\tconst { container, index } = getNewElementContainer( currentElementContainer, newElement );\n\n\tconst newElementInstance = createElement( {\n\t\tcontainer,\n\t\tmodel: newElement,\n\t\toptions: { at: index, useHistory: withHistory },\n\t} );\n\n\tawait deleteElement( { container: currentElementContainer, options: { useHistory: withHistory } } );\n\n\treturn newElementInstance;\n};\n\nfunction getNewElementContainer(\n\tcurrentElementContainer: V1Element,\n\tnewElement: Omit< V1ElementModelProps, 'id' >\n): ElementLocation {\n\tconst { parent } = currentElementContainer;\n\n\tif ( ! parent ) {\n\t\tthrow new ElementParentNotFoundError( { context: { elementId: currentElementContainer.id } } );\n\t}\n\n\tconst elementIndex = currentElementContainer.view?._index ?? 0;\n\n\tif ( elementIndex === -1 ) {\n\t\tthrow new ElementIndexNotFoundError( { context: { elementId: currentElementContainer.id } } );\n\t}\n\n\tlet location: ElementLocation = { container: parent, index: elementIndex };\n\n\tif ( parent.id === 'document' && newElement.elType === 'widget' ) {\n\t\tlocation = createWrapperForWidget( parent, elementIndex );\n\t}\n\n\treturn location;\n}\n\nconst DEFAULT_CONTAINER_TYPE = 'e-flexbox';\n\nfunction createWrapperForWidget( parent: V1Element, elementIndex: number ): ElementLocation {\n\tconst container = createElement( {\n\t\tcontainer: parent,\n\t\tmodel: { elType: DEFAULT_CONTAINER_TYPE },\n\t\toptions: { at: elementIndex, useHistory: false },\n\t} );\n\n\treturn { container, index: 0 };\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1ElementModelProps } from '..';\nimport { getContainer } from './get-container';\n\nexport const updateElementEditorSettings = ( {\n\telementId,\n\tsettings,\n}: {\n\telementId: string;\n\tsettings: V1ElementModelProps[ 'editor_settings' ];\n} ) => {\n\tconst element = getContainer( elementId );\n\n\tif ( ! element ) {\n\t\tthrow new Error( `Element with id ${ elementId } not found` );\n\t}\n\n\tconst editorSettings = element.model.get( 'editor_settings' ) ?? {};\n\n\telement.model.set( 'editor_settings', { ...editorSettings, ...settings } );\n\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n};\n","import { type Props } from '@elementor/editor-props';\nimport { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport type UpdateElementSettingsArgs = {\n\tid: ElementID;\n\tprops: Props;\n\twithHistory?: boolean;\n};\n\nexport const updateElementSettings = ( { id, props, withHistory = true }: UpdateElementSettingsArgs ) => {\n\tconst container = getContainer( id );\n\n\tif ( ! container ) {\n\t\treturn;\n\t}\n\n\tconst args = {\n\t\tcontainer,\n\t\tsettings: { ...props },\n\t};\n\n\tif ( withHistory ) {\n\t\trunCommandSync( 'document/elements/settings', args );\n\t} else {\n\t\trunCommandSync( 'document/elements/set-settings', args, { internal: true } );\n\t}\n};\n","import { type LinkPropValue } from '@elementor/editor-props';\n\nimport { getContainer } from './sync/get-container';\nimport { getElementSetting } from './sync/get-element-setting';\n\nconst ANCHOR_SELECTOR = 'a, [data-action-link]';\n\ntype LinkValue = LinkPropValue[ 'value' ];\n\nexport type LinkInLinkRestriction =\n\t| {\n\t\t\tshouldRestrict: true;\n\t\t\treason: 'ancestor' | 'descendant';\n\t\t\telementId: string | null;\n\t }\n\t| {\n\t\t\tshouldRestrict: false;\n\t\t\treason?: never;\n\t\t\telementId?: never;\n\t };\n\nexport function getLinkInLinkRestriction( elementId: string, resolvedValue?: LinkValue ): LinkInLinkRestriction {\n\tconst anchoredDescendantId = getAnchoredDescendantId( elementId );\n\n\tif ( anchoredDescendantId ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'descendant',\n\t\t\telementId: anchoredDescendantId,\n\t\t};\n\t}\n\n\tconst hasInlineLink = checkForInlineLink( elementId, resolvedValue );\n\n\tif ( hasInlineLink ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'descendant',\n\t\t\telementId,\n\t\t};\n\t}\n\n\tconst ancestor = getAnchoredAncestorId( elementId );\n\n\tif ( ancestor ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'ancestor',\n\t\t\telementId: ancestor,\n\t\t};\n\t}\n\n\treturn {\n\t\tshouldRestrict: false,\n\t};\n}\n\nexport function getAnchoredDescendantId( elementId: string ): string | null {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element ) {\n\t\treturn null;\n\t}\n\n\tfor ( const childAnchorElement of Array.from( element.querySelectorAll( ANCHOR_SELECTOR ) ) ) {\n\t\t// Ensure the child is not in the current element's scope\n\t\tconst childElementId = findElementIdOf( childAnchorElement );\n\n\t\tif ( childElementId !== elementId ) {\n\t\t\treturn childElementId;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function getAnchoredAncestorId( elementId: string ): string | null {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element || element.parentElement === null ) {\n\t\treturn null;\n\t}\n\n\tconst parentAnchor = element.parentElement.closest( ANCHOR_SELECTOR );\n\n\treturn parentAnchor ? findElementIdOf( parentAnchor ) : null;\n}\n\nexport function isElementAnchored( elementId: string ): boolean {\n\tconst element = getElementDOM( elementId ) as HTMLElement;\n\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tif ( element.matches( ANCHOR_SELECTOR ) ) {\n\t\treturn true;\n\t}\n\n\treturn doesElementContainAnchor( element );\n}\n\nfunction doesElementContainAnchor( element: Element ): boolean {\n\tfor ( const child of Array.from( element.children ) as HTMLElement[] ) {\n\t\tif ( isElementorElement( child ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( child.matches( ANCHOR_SELECTOR ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( doesElementContainAnchor( child ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nfunction findElementIdOf( element: Element ): string | null {\n\treturn element.closest< HTMLElement >( '[data-id]' )?.dataset.id || null;\n}\n\nfunction checkForInlineLink( elementId: string, resolvedValue?: LinkValue ): boolean {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tif ( element.matches( ANCHOR_SELECTOR ) ) {\n\t\treturn false;\n\t}\n\n\tconst linkSetting = resolvedValue ?? getElementSetting< LinkPropValue >( elementId, 'link' )?.value;\n\n\tif ( linkSetting?.destination ) {\n\t\treturn false;\n\t}\n\n\treturn element.querySelector( ANCHOR_SELECTOR ) !== null;\n}\n\nfunction getElementDOM( id: string ) {\n\ttry {\n\t\treturn getContainer( id )?.view?.el || null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction isElementorElement( element: Element ): boolean {\n\treturn element.hasAttribute( 'data-id' );\n}\n","import { commandEndEvent, windowEvent } from '@elementor/editor-v1-adapters';\n\nexport const ELEMENT_STYLE_CHANGE_EVENT = 'elementor/editor-v2/editor-elements/style';\n\nexport const styleRerenderEvents = [\n\tcommandEndEvent( 'document/elements/create' ),\n\tcommandEndEvent( 'document/elements/duplicate' ),\n\tcommandEndEvent( 'document/elements/import' ),\n\tcommandEndEvent( 'document/elements/paste' ),\n\twindowEvent( ELEMENT_STYLE_CHANGE_EVENT ),\n];\n","import { classesPropTypeUtil } from '@elementor/editor-props';\nimport {\n\tgenerateId,\n\ttype StyleDefinition,\n\ttype StyleDefinitionID,\n\ttype StyleDefinitionVariant,\n} from '@elementor/editor-styles';\n\nimport { getElementSetting } from '../sync/get-element-setting';\nimport { updateElementSettings } from '../sync/update-element-settings';\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport type CreateElementStyleArgs = {\n\tstyleId?: StyleDefinitionID;\n\telementId: ElementID;\n\tclassesProp: string;\n\tlabel: string;\n\tmeta: StyleDefinitionVariant[ 'meta' ];\n\tprops: StyleDefinitionVariant[ 'props' ];\n\tcustom_css?: StyleDefinitionVariant[ 'custom_css' ];\n\tadditionalVariants?: StyleDefinitionVariant[];\n};\n\nexport function createElementStyle( {\n\tstyleId,\n\telementId,\n\tclassesProp,\n\tlabel,\n\tmeta,\n\tprops,\n\tcustom_css: customCss = null,\n\tadditionalVariants = [],\n}: CreateElementStyleArgs ): string {\n\tlet id = styleId;\n\n\tmutateElementStyles( elementId, ( styles ) => {\n\t\tid ??= generateId( `e-${ elementId }-`, Object.keys( styles ) );\n\n\t\tconst variants = [ { meta, props, custom_css: customCss }, ...additionalVariants ];\n\n\t\tstyles[ id ] = {\n\t\t\tid,\n\t\t\tlabel,\n\t\t\ttype: 'class',\n\t\t\tvariants,\n\t\t} satisfies StyleDefinition;\n\n\t\taddStyleToClassesProp( elementId, classesProp, id );\n\n\t\treturn styles;\n\t} );\n\n\treturn id as string;\n}\n\nfunction addStyleToClassesProp( elementId: ElementID, classesProp: string, styleId: string ) {\n\tconst base = getElementSetting( elementId, classesProp );\n\n\tconst classesPropValue = classesPropTypeUtil.create(\n\t\t( prev ) => {\n\t\t\treturn [ ...( prev ?? [] ), styleId ];\n\t\t},\n\t\t{ base }\n\t);\n\n\tupdateElementSettings( {\n\t\tid: elementId,\n\t\tprops: {\n\t\t\t[ classesProp ]: classesPropValue,\n\t\t},\n\t\twithHistory: false,\n\t} );\n}\n\nexport function shouldCreateNewLocalStyle< T >(\n\tpayload: { styleId: StyleDefinition[ 'id' ] | null; provider: T | null } | null\n) {\n\treturn ! payload?.styleId && ! payload?.provider;\n}\n","import { classesPropTypeUtil, type ClassesPropValue } from '@elementor/editor-props';\nimport { type StyleDefinition, type StyleDefinitionsMap } from '@elementor/editor-styles';\nimport { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { ElementNotFoundError } from '../errors';\nimport { getContainer } from '../sync/get-container';\nimport { type V1Element } from '../sync/types';\nimport { updateElementSettings } from '../sync/update-element-settings';\nimport { type ElementID } from '../types';\nimport { ELEMENT_STYLE_CHANGE_EVENT } from './consts';\n\ntype Mutator = ( styles: StyleDefinitionsMap ) => StyleDefinitionsMap;\n\nexport function mutateElementStyles( elementId: ElementID, mutator: Mutator ) {\n\tconst container = getContainer( elementId );\n\n\tif ( ! container ) {\n\t\tthrow new ElementNotFoundError( { context: { elementId } } );\n\t}\n\n\tconst oldIds = Object.keys( container.model.get( 'styles' ) ?? {} );\n\n\tconst styles = mutateStyles( container, mutator );\n\n\tconst newIds = Object.keys( styles );\n\n\tclearRemovedClasses( container, {\n\t\toldIds,\n\t\tnewIds,\n\t} );\n\n\tnotifyChanges();\n\n\treturn styles;\n}\n\nfunction mutateStyles( container: V1Element, mutator: Mutator ) {\n\tconst styles: StyleDefinitionsMap = structuredClone( container.model.get( 'styles' ) ) ?? {};\n\n\tconst entries = Object.entries( mutator( styles ) )\n\t\t.map( ( [ styleId, style ] ) => {\n\t\t\tstyle.variants = removeEmptyVariants( style );\n\n\t\t\treturn [ styleId, style ] as const;\n\t\t} )\n\t\t.filter( ( [ , style ] ) => {\n\t\t\treturn ! isStyleEmpty( style );\n\t\t} );\n\n\tconst mutatedStyles = Object.fromEntries( entries );\n\n\tcontainer.model.set( 'styles', mutatedStyles );\n\n\treturn mutatedStyles;\n}\n\nfunction removeEmptyVariants( style: StyleDefinition ) {\n\treturn style.variants.filter(\n\t\t( { props, custom_css: customCss } ) => Object.keys( props ).length > 0 || customCss?.raw\n\t);\n}\n\nfunction isStyleEmpty( style: StyleDefinition ) {\n\treturn style.variants.length === 0;\n}\n\nfunction clearRemovedClasses( container: V1Element, { oldIds, newIds }: { oldIds: string[]; newIds: string[] } ) {\n\tconst removedIds = oldIds.filter( ( id ) => ! newIds.includes( id ) );\n\tconst classesProps = structuredClone( getClassesProps( container ) );\n\n\tclassesProps.forEach( ( [ , prop ] ) => {\n\t\tprop.value = prop.value.filter( ( value ) => ! removedIds.includes( value ) );\n\t} );\n\n\tupdateElementSettings( {\n\t\tid: container.id,\n\t\tprops: Object.fromEntries( classesProps ),\n\t\twithHistory: false,\n\t} );\n}\n\nfunction getClassesProps( container: V1Element ) {\n\treturn Object.entries( container.settings.toJSON() ).filter( ( prop ): prop is [ string, ClassesPropValue ] => {\n\t\tconst [ , value ] = prop;\n\n\t\treturn classesPropTypeUtil.isValid( value );\n\t} );\n}\n\nfunction notifyChanges() {\n\tdispatchChangeEvent();\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n}\n\nfunction dispatchChangeEvent() {\n\twindow.dispatchEvent( new CustomEvent( ELEMENT_STYLE_CHANGE_EVENT ) );\n}\n","import { type StyleDefinitionID } from '@elementor/editor-styles';\n\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport function deleteElementStyle( elementId: ElementID, styleId: StyleDefinitionID ) {\n\tmutateElementStyles( elementId, ( styles ) => {\n\t\t// The object is deep cloned so mutating it is fine.\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete styles[ styleId ];\n\n\t\treturn styles;\n\t} );\n}\n","import { mergeProps } from '@elementor/editor-props';\nimport { getVariantByMeta, type StyleDefinition, type StyleDefinitionVariant } from '@elementor/editor-styles';\n\nimport { StyleNotFoundError } from '../errors';\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport type UpdateElementStyleArgs = {\n\telementId: ElementID;\n\tstyleId: StyleDefinition[ 'id' ];\n\tmeta: StyleDefinitionVariant[ 'meta' ];\n\tprops: StyleDefinitionVariant[ 'props' ];\n\tcustom_css?: StyleDefinitionVariant[ 'custom_css' ];\n};\n\nexport function updateElementStyle( args: UpdateElementStyleArgs ) {\n\tmutateElementStyles( args.elementId, ( styles ) => {\n\t\tconst style = styles[ args.styleId ];\n\n\t\tif ( ! style ) {\n\t\t\tthrow new StyleNotFoundError( { context: { styleId: args.styleId } } );\n\t\t}\n\n\t\tconst variant = getVariantByMeta( style, args.meta );\n\t\tconst customCss = ( 'custom_css' in args ? args.custom_css : variant?.custom_css ) ?? null;\n\n\t\tif ( variant ) {\n\t\t\tvariant.props = mergeProps( variant.props, args.props );\n\t\t\tvariant.custom_css = customCss?.raw ? customCss : null;\n\t\t} else {\n\t\t\tstyle.variants.push( { meta: args.meta, props: args.props, custom_css: customCss } );\n\t\t}\n\n\t\treturn styles;\n\t} );\n}\n","import { useState } from 'react';\nimport { __privateUseListenTo as useListenTo, windowEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementInteractions } from '../sync/get-element-interactions';\nimport { type ElementInteractions } from '../sync/types';\nimport { type ElementID } from '../types';\n\nexport const useElementInteractions = ( elementId: ElementID ) => {\n\tconst [ interactions, setInteractions ] = useState< ElementInteractions >( () => {\n\t\tconst initial = getElementInteractions( elementId );\n\n\t\treturn initial ?? { version: 1, items: [] };\n\t} );\n\n\tuseListenTo(\n\t\twindowEvent( 'elementor/element/update_interactions' ),\n\t\t() => {\n\t\t\tconst newInteractions = getElementInteractions( elementId );\n\t\t\tsetInteractions( newInteractions ?? { version: 1, items: [] } );\n\t\t},\n\t\t[ elementId ]\n\t);\n\n\treturn interactions;\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\nimport { type ElementInteractions } from './types';\n\nexport function getElementInteractions( elementId: ElementID ): ElementInteractions | undefined {\n\tconst container = getContainer( elementId );\n\n\tconst interactions = container?.model?.get( 'interactions' );\n\n\tif ( typeof interactions === 'string' ) {\n\t\treturn JSON.parse( interactions ) as ElementInteractions;\n\t}\n\n\treturn interactions;\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1ElementModelProps } from '..';\nimport { getContainer } from './get-container';\n\nexport const updateElementInteractions = ( {\n\telementId,\n\tinteractions,\n}: {\n\telementId: string;\n\tinteractions: V1ElementModelProps[ 'interactions' ];\n} ) => {\n\tconst element = getContainer( elementId );\n\n\tif ( ! element ) {\n\t\tthrow new Error( `Element with id ${ elementId } not found` );\n\t}\n\n\telement.model.set( 'interactions', interactions );\n\n\twindow.dispatchEvent( new CustomEvent( 'elementor/element/update_interactions' ) );\n\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n};\n\nexport const playElementInteractions = ( elementId: string, interactionId: string ) => {\n\twindow.top?.dispatchEvent(\n\t\tnew CustomEvent( 'atomic/play_interactions', { detail: { elementId, interactionId } } )\n\t);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,6BAAmF;;;ACAnF,gCAAkD;AAI3C,SAAS,aAAc,IAA+B;AAC5D,QAAM,iBAAiB;AACvB,QAAM,YAAY,eAAe,W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enTo","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","runCommandSync","import_editor_v1_adapters","import_editor_v1_adapters","runCommand","import_editor_v1_adapters","runCommandSync","import_editor_v1_adapters","runCommandSync","import_editor_v1_adapters","import_i18n","import_editor_v1_adapters","import_i18n","import_editor_v1_adapters","import_i18n","import_editor_v1_adapters","runCommandSync","import_editor_v1_adapters","runCommandSync","import_editor_v1_adapters","import_editor_props","import_editor_v1_adapters","runCommandSync","import_editor_props","import_editor_styles","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","runCommandSync"]}
package/dist/index.mjs CHANGED
@@ -173,7 +173,8 @@ function getElementType(type) {
173
173
  propsSchema: elementType.atomic_props_schema,
174
174
  dependenciesPerTargetMapping: elementType.dependencies_per_target_mapping ?? {},
175
175
  title: elementType.title,
176
- styleStates: elementType.atomic_style_states ?? []
176
+ styleStates: elementType.atomic_style_states ?? [],
177
+ pseudoStates: elementType.atomic_pseudo_states ?? []
177
178
  };
178
179
  }
179
180
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/use-element-children.ts","../src/sync/get-container.ts","../src/sync/model-utils.ts","../src/hooks/use-element-editor-settings.ts","../src/sync/get-element-editor-settings.ts","../src/hooks/use-element-setting.ts","../src/sync/get-element-setting.ts","../src/hooks/use-parent-element.ts","../src/hooks/use-selected-element.ts","../src/sync/get-widgets-cache.ts","../src/sync/get-element-type.ts","../src/sync/get-selected-elements.ts","../src/sync/create-element.ts","../src/sync/create-elements.ts","../src/sync/delete-element.ts","../src/sync/drop-element.ts","../src/sync/duplicate-element.ts","../src/sync/duplicate-elements.ts","../src/sync/generate-element-id.ts","../src/sync/get-current-document-container.ts","../src/sync/get-current-document-id.ts","../src/errors.ts","../src/sync/get-element-label.ts","../src/sync/get-element-styles.ts","../src/sync/get-all-descendants.ts","../src/sync/get-elements.ts","../src/sync/move-element.ts","../src/sync/move-elements.ts","../src/sync/remove-elements.ts","../src/sync/replace-element.ts","../src/sync/update-element-editor-settings.ts","../src/sync/update-element-settings.ts","../src/link-restriction.ts","../src/styles/consts.ts","../src/styles/create-element-style.ts","../src/styles/mutate-element-styles.ts","../src/styles/delete-element-style.ts","../src/styles/update-element-style.ts","../src/hooks/use-element-interactions.ts","../src/sync/get-element-interactions.ts","../src/sync/update-element-interactions.ts"],"sourcesContent":["import { __privateUseListenTo as useListenTo, commandEndEvent, v1ReadyEvent } from '@elementor/editor-v1-adapters';\n\nimport { getContainer } from '../sync/get-container';\nimport { findChildRecursive, getElementChildren, type ModelResult } from '../sync/model-utils';\nimport { type V1ElementEditorSettingsProps } from '../sync/types';\nimport { type ElementID } from '../types';\n\nexport type ElementModel = {\n\tid: string;\n\teditorSettings: V1ElementEditorSettingsProps;\n};\n\nexport type ElementChildren = Record< string, ElementModel[] >;\n\nfunction toElementModel( { model }: ModelResult ): ElementModel {\n\treturn {\n\t\tid: model.get( 'id' ) as string,\n\t\teditorSettings: model.get( 'editor_settings' ) ?? {},\n\t};\n}\n\nexport function useElementChildren< T extends ElementChildren >(\n\telementId: ElementID,\n\tchildrenTypes: Record< string, string >\n): T {\n\treturn useListenTo(\n\t\t[\n\t\t\tv1ReadyEvent(),\n\t\t\tcommandEndEvent( 'document/elements/create' ),\n\t\t\tcommandEndEvent( 'document/elements/delete' ),\n\t\t\tcommandEndEvent( 'document/elements/update' ),\n\t\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t],\n\t\t() => {\n\t\t\tconst container = getContainer( elementId );\n\t\t\tconst model = container?.model;\n\n\t\t\tif ( ! model ) {\n\t\t\t\treturn {} as ElementChildren;\n\t\t\t}\n\n\t\t\tconst elementChildren = Object.entries( childrenTypes ).reduce( ( acc, [ parentType, childType ] ) => {\n\t\t\t\tconst parent = findChildRecursive( model, ( m ) => m.get( 'elType' ) === parentType );\n\n\t\t\t\tif ( ! parent ) {\n\t\t\t\t\tacc[ childType ] = [];\n\t\t\t\t\treturn acc;\n\t\t\t\t}\n\n\t\t\t\tconst children = getElementChildren( parent.model, ( m ) => m.get( 'elType' ) === childType );\n\n\t\t\t\tacc[ childType ] = children.map( toElementModel );\n\n\t\t\t\treturn acc;\n\t\t\t}, {} as ElementChildren );\n\n\t\t\treturn elementChildren;\n\t\t},\n\t\t[ elementId ]\n\t) as T;\n}\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\n\nimport { type ExtendedWindow, type V1Element } from './types';\n\nexport function getContainer( id: string ): V1Element | null {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\tconst container = extendedWindow.elementor?.getContainer?.( id );\n\n\treturn container ?? null;\n}\n\nexport const selectElement = ( elementId: string ) => {\n\ttry {\n\t\tconst container = getContainer( elementId );\n\n\t\trunCommand( 'document/elements/select', { container } );\n\t} catch {}\n};\n","import { type V1Element } from './types';\n\nexport type V1Model = V1Element[ 'model' ];\n\nexport type V1Collection = V1Model[] & {\n\tremove: ( model: V1Model ) => void;\n\tadd: ( model: V1Model, options?: { at?: number }, silent?: boolean ) => void;\n\tindexOf: ( model: V1Model ) => number;\n};\n\nexport type ModelResult = {\n\tmodel: V1Model;\n};\n\nexport function findChildRecursive( model: V1Model, predicate: ( model: V1Model ) => boolean ): ModelResult | null {\n\tconst childModels = ( model.get( 'elements' ) ?? [] ) as V1Model[];\n\n\tfor ( const childModel of childModels ) {\n\t\tif ( predicate( childModel ) ) {\n\t\t\treturn { model: childModel };\n\t\t}\n\n\t\tconst found = findChildRecursive( childModel, predicate );\n\n\t\tif ( found ) {\n\t\t\treturn found;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function getElementChildren( model: V1Model, predicate?: ( model: V1Model ) => boolean ): ModelResult[] {\n\tconst childModels = ( model.get( 'elements' ) ?? [] ) as V1Model[];\n\n\treturn childModels\n\t\t.filter( ( childModel ) => ! predicate || predicate( childModel ) )\n\t\t.map( ( childModel ) => ( { model: childModel } ) );\n}\n","import { __privateUseListenTo as useListenTo, windowEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementEditorSettings } from '../sync/get-element-editor-settings';\nimport { type ElementID } from '../types';\n\nexport const useElementEditorSettings = ( elementId: ElementID ) => {\n\treturn useListenTo(\n\t\twindowEvent( 'elementor/element/update_editor_settings' ),\n\t\t() => getElementEditorSettings( elementId ),\n\t\t[ elementId ]\n\t);\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport function getElementEditorSettings( elementId: ElementID ) {\n\tconst container = getContainer( elementId );\n\n\treturn container?.model.get( 'editor_settings' ) ?? {};\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementSetting } from '../sync/get-element-setting';\nimport { type ElementID } from '../types';\n\nexport const useElementSetting = < TValue >( elementId: ElementID, settingKey: string ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t() => getElementSetting< TValue >( elementId, settingKey ),\n\t\t[ elementId, settingKey ]\n\t);\n};\n\nexport const useElementSettings = < TValue >( elementId: ElementID, settingKeys: string[] ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t() =>\n\t\t\tsettingKeys.reduce< Record< string, TValue > >( ( settings, key ) => {\n\t\t\t\tconst value = getElementSetting< TValue >( elementId, key );\n\n\t\t\t\tif ( value !== null ) {\n\t\t\t\t\tsettings[ key ] = value;\n\t\t\t\t}\n\n\t\t\t\treturn settings;\n\t\t\t}, {} ),\n\t\t[ elementId, settingKeys.join( ',' ) ]\n\t);\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport const getElementSetting = < TValue >( elementId: ElementID, settingKey: string ): TValue | null => {\n\tconst container = getContainer( elementId );\n\n\treturn ( container?.settings?.get( settingKey ) as TValue ) ?? null;\n};\n\nexport const getElementSettings = < TValue >(\n\telementId: ElementID,\n\tsettingKey: string[]\n): Record< string, TValue | null > => {\n\treturn Object.fromEntries( settingKey.map( ( key ) => [ key, getElementSetting( elementId, key ) ] ) );\n};\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { type ExtendedWindow } from '../sync/types';\n\nexport function useParentElement( elementId: string | null ) {\n\treturn useListenTo(\n\t\t[ commandEndEvent( 'document/elements/create' ) ],\n\t\t() => {\n\t\t\tif ( ! elementId ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst extendedWindow = window as unknown as ExtendedWindow;\n\t\t\tconst element = extendedWindow?.elementor?.getContainer?.( elementId );\n\t\t\tif ( ! element ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn element.parent;\n\t\t},\n\t\t[ elementId ]\n\t);\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementType } from '../sync/get-element-type';\nimport { getSelectedElements } from '../sync/get-selected-elements';\n\nexport function useSelectedElement() {\n\tconst elements = useListenTo(\n\t\t[\n\t\t\tcommandEndEvent( 'document/elements/select' ),\n\t\t\tcommandEndEvent( 'document/elements/deselect' ),\n\t\t\tcommandEndEvent( 'document/elements/select-all' ),\n\t\t\tcommandEndEvent( 'document/elements/deselect-all' ),\n\t\t],\n\t\tgetSelectedElements\n\t);\n\n\tconst [ element ] = elements;\n\n\tconst elementType = getElementType( element?.type );\n\n\tif ( elements.length !== 1 || ! elementType ) {\n\t\treturn { element: null, elementType: null };\n\t}\n\n\treturn { element, elementType };\n}\n","import { type ExtendedWindow, type V1ElementConfig } from '../sync/types.js';\ntype WidgetsCache< T > = Record< string, T >;\n\nexport function getWidgetsCache< T extends V1ElementConfig >(): WidgetsCache< T > | null {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn ( extendedWindow?.elementor?.widgetsCache as WidgetsCache< T > ) || null;\n}\n","import { type ElementType } from '../types';\nimport { getWidgetsCache } from './get-widgets-cache';\n\nexport function getElementType( type: string ): ElementType | null {\n\tif ( ! type ) {\n\t\treturn null;\n\t}\n\n\tconst widgetsCache = getWidgetsCache();\n\tconst elementType = widgetsCache?.[ type ];\n\n\tif ( ! elementType?.atomic_controls ) {\n\t\treturn null;\n\t}\n\n\tif ( ! elementType?.atomic_props_schema ) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tkey: type,\n\t\tcontrols: elementType.atomic_controls,\n\t\tpropsSchema: elementType.atomic_props_schema,\n\t\tdependenciesPerTargetMapping: elementType.dependencies_per_target_mapping ?? {},\n\t\ttitle: elementType.title,\n\t\tstyleStates: elementType.atomic_style_states ?? [],\n\t};\n}\n","import { type Element } from '../types';\nimport { type ExtendedWindow } from './types';\n\nexport function getSelectedElements(): Element[] {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\tconst selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];\n\n\treturn selectedElements.reduce< Element[] >( ( acc, el ) => {\n\t\tconst type = el.model.get( 'widgetType' ) || el.model.get( 'elType' );\n\n\t\tif ( type ) {\n\t\t\tacc.push( {\n\t\t\t\tid: el.model.get( 'id' ),\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\n\t\treturn acc;\n\t}, [] );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element, type V1ElementModelProps, type V1ElementSettingsProps } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tclone?: boolean;\n};\n\nexport type CreateElementParams = {\n\tcontainer: V1Element;\n\tmodel?: Omit< V1ElementModelProps, 'settings' | 'id' > & { settings?: V1ElementSettingsProps; id?: string };\n\toptions?: Options;\n};\n\nexport function createElement( { container, model, options }: CreateElementParams ): V1Element {\n\treturn runCommandSync< V1Element >( 'document/elements/create', {\n\t\tcontainer,\n\t\tmodel,\n\t\toptions: { edit: false, ...options },\n\t} );\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement, type CreateElementParams } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype CreateElementsParams = {\n\telements: CreateElementParams[];\n\ttitle: string;\n\tsubtitle?: string;\n};\n\ntype CreatedElement = {\n\tcontainer: V1Element;\n\tparentContainer: V1Element;\n\tmodel: V1ElementModelProps;\n\toptions?: CreateElementParams[ 'options' ];\n};\n\ntype CreatedElementsResult = {\n\tcreatedElements: CreatedElement[];\n};\n\nexport type { CreateElementsParams, CreatedElement, CreatedElementsResult };\n\nexport const createElements = ( {\n\telements,\n\ttitle,\n\tsubtitle = __( 'Item added', 'elementor' ),\n}: CreateElementsParams ): CreatedElementsResult => {\n\tconst undoableCreate = undoable(\n\t\t{\n\t\t\tdo: ( { elements: elementsParam }: { elements: CreateElementParams[] } ): CreatedElementsResult => {\n\t\t\t\tconst createdElements: CreatedElement[] = [];\n\n\t\t\t\telementsParam.forEach( ( { container, options, ...elementParams } ) => {\n\t\t\t\t\tconst parentContainer = container.lookup?.() ?? container;\n\n\t\t\t\t\tif ( ! parentContainer ) {\n\t\t\t\t\t\tthrow new Error( 'Parent container not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tconst element = createElement( {\n\t\t\t\t\t\tcontainer: parentContainer,\n\t\t\t\t\t\t...elementParams,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tcreatedElements.push( {\n\t\t\t\t\t\tcontainer: element,\n\t\t\t\t\t\tparentContainer,\n\t\t\t\t\t\tmodel: element.model?.toJSON() || {},\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { createdElements };\n\t\t\t},\n\t\t\tundo: ( _: { elements: CreateElementParams[] }, { createdElements }: CreatedElementsResult ) => {\n\t\t\t\t[ ...createdElements ].reverse().forEach( ( { container } ) => {\n\t\t\t\t\tconst freshContainer = container.lookup?.();\n\n\t\t\t\t\tif ( freshContainer ) {\n\t\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elements: CreateElementParams[] },\n\t\t\t\t{ createdElements }: CreatedElementsResult\n\t\t\t): CreatedElementsResult => {\n\t\t\t\tconst newElements: CreatedElement[] = [];\n\n\t\t\t\tcreatedElements.forEach( ( { parentContainer, model, options } ) => {\n\t\t\t\t\tconst freshParent = parentContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshParent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst element = createElement( {\n\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewElements.push( {\n\t\t\t\t\t\tcontainer: element,\n\t\t\t\t\t\tparentContainer: freshParent,\n\t\t\t\t\t\tmodel: element.model.toJSON(),\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { createdElements: newElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableCreate( { elements } );\n};\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n};\n\ntype DeleteElementParams = {\n\tcontainer: V1Element;\n\toptions?: Options;\n};\n\nexport function deleteElement( { container, options = {} }: DeleteElementParams ): Promise< void > {\n\treturn runCommand( 'document/elements/delete', {\n\t\tcontainer,\n\t\toptions,\n\t} );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps, type V1ElementSettingsProps } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tscrollIntoView: boolean;\n};\n\nexport type DropElementParams = {\n\tcontainerId: string;\n\toptions?: Options;\n\tmodel?: Omit< V1ElementModelProps, 'settings' | 'id' > & { settings?: V1ElementSettingsProps; id?: string };\n};\n\nexport function dropElement( { containerId, model, options }: DropElementParams ) {\n\tconst container = getContainer( containerId );\n\n\tif ( ! container ) {\n\t\tthrow new Error( `Container with ID \"${ containerId }\" not found` );\n\t}\n\n\treturn runCommandSync< V1Element >( 'preview/drop', {\n\t\tcontainer,\n\t\tmodel,\n\t\toptions,\n\t} );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tclone?: boolean;\n};\n\nexport type DuplicateElementParams = {\n\telement: V1Element;\n\toptions?: Options;\n};\n\nexport function duplicateElement( { element, options = {} }: DuplicateElementParams ): V1Element {\n\tconst currentIndex = element.view?._index ?? 0;\n\tconst insertPosition = options.clone !== false ? currentIndex + 1 : undefined;\n\n\treturn runCommandSync< V1Element >( 'document/elements/duplicate', {\n\t\tcontainer: element,\n\t\toptions: { at: insertPosition, edit: false, ...options },\n\t} );\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { duplicateElement } from './duplicate-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype DuplicateElementsParams = {\n\telementIds: string[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonDuplicateElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype DuplicatedElement = {\n\tcontainer: V1Element;\n\tparentContainer: V1Element;\n\tmodel: V1ElementModelProps;\n\tat?: number;\n};\n\ntype DuplicatedElementsResult = {\n\tduplicatedElements: DuplicatedElement[];\n};\n\nexport type { DuplicateElementsParams, DuplicatedElement, DuplicatedElementsResult };\n\nexport const duplicateElements = ( {\n\telementIds,\n\ttitle,\n\tsubtitle = __( 'Item duplicated', 'elementor' ),\n\tonDuplicateElements,\n\tonRestoreElements,\n}: DuplicateElementsParams ): DuplicatedElementsResult => {\n\tconst undoableDuplicate = undoable(\n\t\t{\n\t\t\tdo: ( { elementIds: elementIdsToDuplicate }: { elementIds: string[] } ): DuplicatedElementsResult => {\n\t\t\t\tonDuplicateElements?.();\n\t\t\t\tconst duplicatedElements: DuplicatedElement[] = [];\n\n\t\t\t\telementIdsToDuplicate.forEach( ( elementId ) => {\n\t\t\t\t\tconst originalContainer = getContainer( elementId );\n\n\t\t\t\t\tif ( ! originalContainer?.parent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst duplicatedElement = duplicateElement( {\n\t\t\t\t\t\telement: originalContainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( ! duplicatedElement.parent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tduplicatedElements.push( {\n\t\t\t\t\t\tcontainer: duplicatedElement,\n\t\t\t\t\t\tparentContainer: duplicatedElement.parent,\n\t\t\t\t\t\tmodel: duplicatedElement.model.toJSON(),\n\t\t\t\t\t\tat: duplicatedElement.view?._index,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { duplicatedElements };\n\t\t\t},\n\t\t\tundo: ( _: { elementIds: string[] }, { duplicatedElements }: DuplicatedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\t\t\t\t[ ...duplicatedElements ].reverse().forEach( ( { container } ) => {\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elementIds: string[] },\n\t\t\t\t{ duplicatedElements: previousElements }: DuplicatedElementsResult\n\t\t\t): DuplicatedElementsResult => {\n\t\t\t\tonDuplicateElements?.();\n\t\t\t\tconst duplicatedElements: DuplicatedElement[] = [];\n\n\t\t\t\tpreviousElements.forEach( ( { parentContainer, model, at } ) => {\n\t\t\t\t\tconst freshParent = parentContainer.lookup?.();\n\n\t\t\t\t\tif ( freshParent ) {\n\t\t\t\t\t\tconst createdElement = createElement( {\n\t\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\toptions: { useHistory: false, clone: false, at },\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tduplicatedElements.push( {\n\t\t\t\t\t\t\tcontainer: createdElement,\n\t\t\t\t\t\t\tparentContainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\tat,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\treturn { duplicatedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableDuplicate( { elementIds } );\n};\n","import { type ExtendedWindow } from './types';\n\nexport const generateElementId = () => {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn (\n\t\textendedWindow.elementorCommon?.helpers?.getUniqueId?.() ??\n\t\t`el-${ Date.now() }-${ Math.random().toString( 36 ).substring( 2, 9 ) }`\n\t);\n};\n","import { type ExtendedWindow } from './types';\n\nexport function getCurrentDocumentContainer() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.documents?.getCurrent?.()?.container ?? null;\n}\n","import { type ExtendedWindow } from './types';\n\nexport function getCurrentDocumentId() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.documents?.getCurrentId?.() ?? null;\n}\n","import { createError } from '@elementor/utils';\n\nexport const ElementNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_not_found',\n\tmessage: 'Element not found.',\n} );\n\nexport const StyleNotFoundError = createError< { styleId: string } >( {\n\tcode: 'style_not_found',\n\tmessage: 'Style not found.',\n} );\n\nexport const ElementTypeNotExistsError = createError< { elementId: string } >( {\n\tcode: 'element_type_not_exists',\n\tmessage: 'Element type does not exist.',\n} );\n\nexport const ElementLabelNotExistsError = createError< { elementType: string } >( {\n\tcode: 'element_label_not_exists',\n\tmessage: 'Element label does not exist.',\n} );\n\nexport const ElementParentNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_parent_not_found',\n\tmessage: 'Element parent not found.',\n} );\n\nexport const ElementIndexNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_index_not_found',\n\tmessage: 'Element index not found.',\n} );\n","import { ElementLabelNotExistsError, ElementTypeNotExistsError } from '../errors';\nimport { getContainer } from '../sync/get-container';\nimport { getWidgetsCache } from '../sync/get-widgets-cache';\nimport { type ElementID } from '../types';\nimport { getSelectedElements } from './get-selected-elements';\n\nexport function getElementLabel( elementId?: ElementID ) {\n\tif ( ! elementId ) {\n\t\telementId = getSelectedElements()?.[ 0 ]?.id;\n\t}\n\n\tconst container = getContainer( elementId );\n\n\tconst type = container?.model.get( 'widgetType' ) || container?.model.get( 'elType' );\n\n\tif ( ! type ) {\n\t\tthrow new ElementTypeNotExistsError( { context: { elementId } } );\n\t}\n\n\tconst label = getWidgetsCache()?.[ type ]?.title;\n\n\tif ( ! label ) {\n\t\tthrow new ElementLabelNotExistsError( { context: { elementType: type } } );\n\t}\n\n\treturn label;\n}\n","import { type StyleDefinition } from '@elementor/editor-styles';\n\nimport { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport const getElementStyles = ( elementID: ElementID ): Record< string, StyleDefinition > | null => {\n\tconst container = getContainer( elementID );\n\n\treturn container?.model.get( 'styles' ) || null;\n};\n","import { type V1Element } from './types';\n\nexport function getAllDescendants( container: V1Element ): V1Element[] {\n\tconst children = ( container.children ?? [] ).flatMap( ( child ) => getAllDescendants( child as V1Element ) );\n\n\treturn [ container, ...children ];\n}\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\nimport { getCurrentDocumentContainer } from './get-current-document-container';\nimport { type V1Element } from './types';\n\nexport function getElements( root?: ElementID ): V1Element[] {\n\tconst container = root ? getContainer( root ) : getCurrentDocumentContainer();\n\n\tif ( ! container ) {\n\t\treturn [];\n\t}\n\n\tconst children = [ ...( container.model.get( 'elements' ) ?? [] ) ].flatMap( ( childModel ) =>\n\t\tgetElements( childModel.get( 'id' ) )\n\t);\n\n\treturn [ container, ...children ];\n}\n","import { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tedit?: boolean;\n};\n\nexport type MoveElementParams = {\n\telement: V1Element;\n\ttargetContainer: V1Element;\n\toptions?: Options;\n};\n\nexport function moveElement( { element, targetContainer, options = {} }: MoveElementParams ): V1Element {\n\tconst resolvedElement = element.lookup?.();\n\tconst resolvedTarget = targetContainer.lookup?.();\n\n\tif ( ! resolvedElement ) {\n\t\tthrow new Error( `Element not found: ${ element.id }` );\n\t}\n\n\tif ( ! resolvedTarget ) {\n\t\tthrow new Error( `Target container not found: ${ targetContainer.id }` );\n\t}\n\n\tconst modelToRecreate = resolvedElement.model.toJSON();\n\n\tdeleteElement( {\n\t\tcontainer: resolvedElement,\n\t\toptions: { ...options, useHistory: false },\n\t} );\n\n\tconst newContainer = createElement( {\n\t\tcontainer: resolvedTarget,\n\t\tmodel: modelToRecreate,\n\t\toptions: { edit: false, ...options, useHistory: false },\n\t} );\n\n\treturn newContainer;\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { moveElement } from './move-element';\nimport { type V1Element } from './types';\n\ntype MoveOptions = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tedit?: boolean;\n};\n\ntype MoveInput = {\n\telement: V1Element;\n\ttargetContainer: V1Element;\n\toptions?: MoveOptions;\n};\n\ntype MoveElementsParams = {\n\tmoves: MoveInput[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonMoveElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype MovedElement = {\n\telement: V1Element;\n\toriginalContainer: V1Element;\n\toriginalIndex: number;\n\ttargetContainer: V1Element;\n\toptions?: MoveOptions;\n};\n\ntype MovedElementsResult = {\n\tmovedElements: MovedElement[];\n};\n\nexport type { MoveElementsParams, MoveInput, MovedElement, MovedElementsResult };\n\nexport const moveElements = ( {\n\tmoves: movesToMake,\n\ttitle,\n\tsubtitle = __( 'Elements moved', 'elementor' ),\n\tonMoveElements,\n\tonRestoreElements,\n}: MoveElementsParams ): MovedElementsResult => {\n\tconst undoableMove = undoable(\n\t\t{\n\t\t\tdo: ( { moves }: { moves: MoveInput[] } ): MovedElementsResult => {\n\t\t\t\tconst movedElements: MovedElement[] = [];\n\t\t\t\tonMoveElements?.();\n\n\t\t\t\tmoves.forEach( ( { element, targetContainer, options } ) => {\n\t\t\t\t\tconst sourceElement = element.lookup?.() ?? element;\n\t\t\t\t\tconst target = targetContainer.lookup?.() ?? targetContainer;\n\n\t\t\t\t\tif ( ! sourceElement ) {\n\t\t\t\t\t\tthrow new Error( 'Element not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! target ) {\n\t\t\t\t\t\tthrow new Error( 'Target container not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! sourceElement.parent ) {\n\t\t\t\t\t\tthrow new Error( 'Element has no parent container' );\n\t\t\t\t\t}\n\n\t\t\t\t\tconst originalContainer = sourceElement.parent;\n\t\t\t\t\tconst originalIndex = originalContainer.children?.indexOf( sourceElement ) ?? -1;\n\n\t\t\t\t\tconst newElement = moveElement( {\n\t\t\t\t\t\telement: sourceElement,\n\t\t\t\t\t\ttargetContainer: target,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tmovedElements.push( {\n\t\t\t\t\t\telement: newElement,\n\t\t\t\t\t\toriginalContainer,\n\t\t\t\t\t\toriginalIndex,\n\t\t\t\t\t\ttargetContainer: target,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { movedElements };\n\t\t\t},\n\t\t\tundo: ( _: { moves: MoveInput[] }, { movedElements }: MovedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\n\t\t\t\t[ ...movedElements ].reverse().forEach( ( { element, originalContainer, originalIndex } ) => {\n\t\t\t\t\tconst freshElement = element.lookup?.();\n\t\t\t\t\tconst freshOriginalContainer = originalContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshElement || ! freshOriginalContainer ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveElement( {\n\t\t\t\t\t\telement: freshElement,\n\t\t\t\t\t\ttargetContainer: freshOriginalContainer,\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tuseHistory: false,\n\t\t\t\t\t\t\tat: originalIndex >= 0 ? originalIndex : undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: ( _: { moves: MoveInput[] }, { movedElements }: MovedElementsResult ): MovedElementsResult => {\n\t\t\t\tconst newMovedElements: MovedElement[] = [];\n\t\t\t\tonMoveElements?.();\n\n\t\t\t\tmovedElements.forEach( ( { element, originalContainer, originalIndex, targetContainer, options } ) => {\n\t\t\t\t\tconst freshElement = element.lookup?.();\n\t\t\t\t\tconst freshOriginalContainer = originalContainer.lookup?.();\n\t\t\t\t\tconst freshTarget = targetContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshElement || ! freshOriginalContainer || ! freshTarget ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst newElement = moveElement( {\n\t\t\t\t\t\telement: freshElement,\n\t\t\t\t\t\ttargetContainer: freshTarget,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewMovedElements.push( {\n\t\t\t\t\t\telement: newElement,\n\t\t\t\t\t\toriginalContainer: freshOriginalContainer,\n\t\t\t\t\t\toriginalIndex,\n\t\t\t\t\t\ttargetContainer: freshTarget,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { movedElements: newMovedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableMove( { moves: movesToMake } );\n};\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype RemoveElementsParams = {\n\telementIds: string[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonRemoveElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype RemovedElement = {\n\tcontainer: V1Element;\n\tparent: V1Element;\n\tmodel: V1ElementModelProps;\n\tat: number;\n};\n\ntype RemovedElementsResult = {\n\tremovedElements: RemovedElement[];\n};\n\nexport const removeElements = ( {\n\telementIds,\n\ttitle,\n\tsubtitle = __( 'Item removed', 'elementor' ),\n\tonRemoveElements,\n\tonRestoreElements,\n}: RemoveElementsParams ): RemovedElementsResult => {\n\tconst undoableRemove = undoable(\n\t\t{\n\t\t\tdo: ( { elementIds: elementIdsParam }: { elementIds: string[] } ): RemovedElementsResult => {\n\t\t\t\tconst removedElements: RemovedElement[] = [];\n\n\t\t\t\telementIdsParam.forEach( ( elementId ) => {\n\t\t\t\t\tconst container = getContainer( elementId );\n\n\t\t\t\t\tif ( container?.parent ) {\n\t\t\t\t\t\tremovedElements.push( {\n\t\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\t\tparent: container.parent,\n\t\t\t\t\t\t\tmodel: container.model.toJSON(),\n\t\t\t\t\t\t\tat: container.view?._index ?? 0,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tonRemoveElements?.();\n\n\t\t\t\tremovedElements.forEach( ( { container } ) => {\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { removedElements };\n\t\t\t},\n\t\t\tundo: ( _: { elementIds: string[] }, { removedElements }: RemovedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\n\t\t\t\t[ ...removedElements ].reverse().forEach( ( { parent, model, at } ) => {\n\t\t\t\t\tconst freshParent = parent.lookup?.();\n\n\t\t\t\t\tif ( freshParent ) {\n\t\t\t\t\t\tcreateElement( {\n\t\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\toptions: { useHistory: false, at },\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elementIds: string[] },\n\t\t\t\t{ removedElements }: RemovedElementsResult\n\t\t\t): RemovedElementsResult => {\n\t\t\t\tonRemoveElements?.();\n\n\t\t\t\tconst newRemovedElements: RemovedElement[] = [];\n\n\t\t\t\tremovedElements.forEach( ( { container, parent, model, at } ) => {\n\t\t\t\t\tconst freshContainer = container.lookup?.();\n\t\t\t\t\tconst freshParent = parent.lookup?.();\n\n\t\t\t\t\tif ( ! freshContainer || ! freshParent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewRemovedElements.push( {\n\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\tparent: freshParent,\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\tat,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { removedElements: newRemovedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableRemove( { elementIds } );\n};\n","import { ElementIndexNotFoundError, ElementNotFoundError, ElementParentNotFoundError } from '../errors';\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementData, type V1ElementModelProps } from './types';\n\ntype ElementLocation = {\n\tcontainer: V1Element;\n\tindex: number;\n};\n\ntype ReplaceElementArgs = {\n\tcurrentElement: V1ElementData;\n\tnewElement: Omit< V1ElementModelProps, 'id' >;\n\twithHistory?: boolean;\n};\n\nexport const replaceElement = async ( { currentElement, newElement, withHistory = true }: ReplaceElementArgs ) => {\n\tconst currentElementContainer = getContainer( currentElement.id );\n\n\tif ( ! currentElementContainer ) {\n\t\tthrow new ElementNotFoundError( { context: { elementId: currentElement.id } } );\n\t}\n\n\tconst { container, index } = getNewElementContainer( currentElementContainer, newElement );\n\n\tconst newElementInstance = createElement( {\n\t\tcontainer,\n\t\tmodel: newElement,\n\t\toptions: { at: index, useHistory: withHistory },\n\t} );\n\n\tawait deleteElement( { container: currentElementContainer, options: { useHistory: withHistory } } );\n\n\treturn newElementInstance;\n};\n\nfunction getNewElementContainer(\n\tcurrentElementContainer: V1Element,\n\tnewElement: Omit< V1ElementModelProps, 'id' >\n): ElementLocation {\n\tconst { parent } = currentElementContainer;\n\n\tif ( ! parent ) {\n\t\tthrow new ElementParentNotFoundError( { context: { elementId: currentElementContainer.id } } );\n\t}\n\n\tconst elementIndex = currentElementContainer.view?._index ?? 0;\n\n\tif ( elementIndex === -1 ) {\n\t\tthrow new ElementIndexNotFoundError( { context: { elementId: currentElementContainer.id } } );\n\t}\n\n\tlet location: ElementLocation = { container: parent, index: elementIndex };\n\n\tif ( parent.id === 'document' && newElement.elType === 'widget' ) {\n\t\tlocation = createWrapperForWidget( parent, elementIndex );\n\t}\n\n\treturn location;\n}\n\nconst DEFAULT_CONTAINER_TYPE = 'e-flexbox';\n\nfunction createWrapperForWidget( parent: V1Element, elementIndex: number ): ElementLocation {\n\tconst container = createElement( {\n\t\tcontainer: parent,\n\t\tmodel: { elType: DEFAULT_CONTAINER_TYPE },\n\t\toptions: { at: elementIndex, useHistory: false },\n\t} );\n\n\treturn { container, index: 0 };\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1ElementModelProps } from '..';\nimport { getContainer } from './get-container';\n\nexport const updateElementEditorSettings = ( {\n\telementId,\n\tsettings,\n}: {\n\telementId: string;\n\tsettings: V1ElementModelProps[ 'editor_settings' ];\n} ) => {\n\tconst element = getContainer( elementId );\n\n\tif ( ! element ) {\n\t\tthrow new Error( `Element with id ${ elementId } not found` );\n\t}\n\n\tconst editorSettings = element.model.get( 'editor_settings' ) ?? {};\n\n\telement.model.set( 'editor_settings', { ...editorSettings, ...settings } );\n\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n};\n","import { type Props } from '@elementor/editor-props';\nimport { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport type UpdateElementSettingsArgs = {\n\tid: ElementID;\n\tprops: Props;\n\twithHistory?: boolean;\n};\n\nexport const updateElementSettings = ( { id, props, withHistory = true }: UpdateElementSettingsArgs ) => {\n\tconst container = getContainer( id );\n\n\tif ( ! container ) {\n\t\treturn;\n\t}\n\n\tconst args = {\n\t\tcontainer,\n\t\tsettings: { ...props },\n\t};\n\n\tif ( withHistory ) {\n\t\trunCommandSync( 'document/elements/settings', args );\n\t} else {\n\t\trunCommandSync( 'document/elements/set-settings', args, { internal: true } );\n\t}\n};\n","import { type LinkPropValue } from '@elementor/editor-props';\n\nimport { getContainer } from './sync/get-container';\nimport { getElementSetting } from './sync/get-element-setting';\n\nconst ANCHOR_SELECTOR = 'a, [data-action-link]';\n\ntype LinkValue = LinkPropValue[ 'value' ];\n\nexport type LinkInLinkRestriction =\n\t| {\n\t\t\tshouldRestrict: true;\n\t\t\treason: 'ancestor' | 'descendant';\n\t\t\telementId: string | null;\n\t }\n\t| {\n\t\t\tshouldRestrict: false;\n\t\t\treason?: never;\n\t\t\telementId?: never;\n\t };\n\nexport function getLinkInLinkRestriction( elementId: string, resolvedValue?: LinkValue ): LinkInLinkRestriction {\n\tconst anchoredDescendantId = getAnchoredDescendantId( elementId );\n\n\tif ( anchoredDescendantId ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'descendant',\n\t\t\telementId: anchoredDescendantId,\n\t\t};\n\t}\n\n\tconst hasInlineLink = checkForInlineLink( elementId, resolvedValue );\n\n\tif ( hasInlineLink ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'descendant',\n\t\t\telementId,\n\t\t};\n\t}\n\n\tconst ancestor = getAnchoredAncestorId( elementId );\n\n\tif ( ancestor ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'ancestor',\n\t\t\telementId: ancestor,\n\t\t};\n\t}\n\n\treturn {\n\t\tshouldRestrict: false,\n\t};\n}\n\nexport function getAnchoredDescendantId( elementId: string ): string | null {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element ) {\n\t\treturn null;\n\t}\n\n\tfor ( const childAnchorElement of Array.from( element.querySelectorAll( ANCHOR_SELECTOR ) ) ) {\n\t\t// Ensure the child is not in the current element's scope\n\t\tconst childElementId = findElementIdOf( childAnchorElement );\n\n\t\tif ( childElementId !== elementId ) {\n\t\t\treturn childElementId;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function getAnchoredAncestorId( elementId: string ): string | null {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element || element.parentElement === null ) {\n\t\treturn null;\n\t}\n\n\tconst parentAnchor = element.parentElement.closest( ANCHOR_SELECTOR );\n\n\treturn parentAnchor ? findElementIdOf( parentAnchor ) : null;\n}\n\nexport function isElementAnchored( elementId: string ): boolean {\n\tconst element = getElementDOM( elementId ) as HTMLElement;\n\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tif ( element.matches( ANCHOR_SELECTOR ) ) {\n\t\treturn true;\n\t}\n\n\treturn doesElementContainAnchor( element );\n}\n\nfunction doesElementContainAnchor( element: Element ): boolean {\n\tfor ( const child of Array.from( element.children ) as HTMLElement[] ) {\n\t\tif ( isElementorElement( child ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( child.matches( ANCHOR_SELECTOR ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( doesElementContainAnchor( child ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nfunction findElementIdOf( element: Element ): string | null {\n\treturn element.closest< HTMLElement >( '[data-id]' )?.dataset.id || null;\n}\n\nfunction checkForInlineLink( elementId: string, resolvedValue?: LinkValue ): boolean {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tif ( element.matches( ANCHOR_SELECTOR ) ) {\n\t\treturn false;\n\t}\n\n\tconst linkSetting = resolvedValue ?? getElementSetting< LinkPropValue >( elementId, 'link' )?.value;\n\n\tif ( linkSetting?.destination ) {\n\t\treturn false;\n\t}\n\n\treturn element.querySelector( ANCHOR_SELECTOR ) !== null;\n}\n\nfunction getElementDOM( id: string ) {\n\ttry {\n\t\treturn getContainer( id )?.view?.el || null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction isElementorElement( element: Element ): boolean {\n\treturn element.hasAttribute( 'data-id' );\n}\n","import { commandEndEvent, windowEvent } from '@elementor/editor-v1-adapters';\n\nexport const ELEMENT_STYLE_CHANGE_EVENT = 'elementor/editor-v2/editor-elements/style';\n\nexport const styleRerenderEvents = [\n\tcommandEndEvent( 'document/elements/create' ),\n\tcommandEndEvent( 'document/elements/duplicate' ),\n\tcommandEndEvent( 'document/elements/import' ),\n\tcommandEndEvent( 'document/elements/paste' ),\n\twindowEvent( ELEMENT_STYLE_CHANGE_EVENT ),\n];\n","import { classesPropTypeUtil } from '@elementor/editor-props';\nimport {\n\tgenerateId,\n\ttype StyleDefinition,\n\ttype StyleDefinitionID,\n\ttype StyleDefinitionVariant,\n} from '@elementor/editor-styles';\n\nimport { getElementSetting } from '../sync/get-element-setting';\nimport { updateElementSettings } from '../sync/update-element-settings';\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport type CreateElementStyleArgs = {\n\tstyleId?: StyleDefinitionID;\n\telementId: ElementID;\n\tclassesProp: string;\n\tlabel: string;\n\tmeta: StyleDefinitionVariant[ 'meta' ];\n\tprops: StyleDefinitionVariant[ 'props' ];\n\tcustom_css?: StyleDefinitionVariant[ 'custom_css' ];\n\tadditionalVariants?: StyleDefinitionVariant[];\n};\n\nexport function createElementStyle( {\n\tstyleId,\n\telementId,\n\tclassesProp,\n\tlabel,\n\tmeta,\n\tprops,\n\tcustom_css: customCss = null,\n\tadditionalVariants = [],\n}: CreateElementStyleArgs ): string {\n\tlet id = styleId;\n\n\tmutateElementStyles( elementId, ( styles ) => {\n\t\tid ??= generateId( `e-${ elementId }-`, Object.keys( styles ) );\n\n\t\tconst variants = [ { meta, props, custom_css: customCss }, ...additionalVariants ];\n\n\t\tstyles[ id ] = {\n\t\t\tid,\n\t\t\tlabel,\n\t\t\ttype: 'class',\n\t\t\tvariants,\n\t\t} satisfies StyleDefinition;\n\n\t\taddStyleToClassesProp( elementId, classesProp, id );\n\n\t\treturn styles;\n\t} );\n\n\treturn id as string;\n}\n\nfunction addStyleToClassesProp( elementId: ElementID, classesProp: string, styleId: string ) {\n\tconst base = getElementSetting( elementId, classesProp );\n\n\tconst classesPropValue = classesPropTypeUtil.create(\n\t\t( prev ) => {\n\t\t\treturn [ ...( prev ?? [] ), styleId ];\n\t\t},\n\t\t{ base }\n\t);\n\n\tupdateElementSettings( {\n\t\tid: elementId,\n\t\tprops: {\n\t\t\t[ classesProp ]: classesPropValue,\n\t\t},\n\t\twithHistory: false,\n\t} );\n}\n\nexport function shouldCreateNewLocalStyle< T >(\n\tpayload: { styleId: StyleDefinition[ 'id' ] | null; provider: T | null } | null\n) {\n\treturn ! payload?.styleId && ! payload?.provider;\n}\n","import { classesPropTypeUtil, type ClassesPropValue } from '@elementor/editor-props';\nimport { type StyleDefinition, type StyleDefinitionsMap } from '@elementor/editor-styles';\nimport { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { ElementNotFoundError } from '../errors';\nimport { getContainer } from '../sync/get-container';\nimport { type V1Element } from '../sync/types';\nimport { updateElementSettings } from '../sync/update-element-settings';\nimport { type ElementID } from '../types';\nimport { ELEMENT_STYLE_CHANGE_EVENT } from './consts';\n\ntype Mutator = ( styles: StyleDefinitionsMap ) => StyleDefinitionsMap;\n\nexport function mutateElementStyles( elementId: ElementID, mutator: Mutator ) {\n\tconst container = getContainer( elementId );\n\n\tif ( ! container ) {\n\t\tthrow new ElementNotFoundError( { context: { elementId } } );\n\t}\n\n\tconst oldIds = Object.keys( container.model.get( 'styles' ) ?? {} );\n\n\tconst styles = mutateStyles( container, mutator );\n\n\tconst newIds = Object.keys( styles );\n\n\tclearRemovedClasses( container, {\n\t\toldIds,\n\t\tnewIds,\n\t} );\n\n\tnotifyChanges();\n\n\treturn styles;\n}\n\nfunction mutateStyles( container: V1Element, mutator: Mutator ) {\n\tconst styles: StyleDefinitionsMap = structuredClone( container.model.get( 'styles' ) ) ?? {};\n\n\tconst entries = Object.entries( mutator( styles ) )\n\t\t.map( ( [ styleId, style ] ) => {\n\t\t\tstyle.variants = removeEmptyVariants( style );\n\n\t\t\treturn [ styleId, style ] as const;\n\t\t} )\n\t\t.filter( ( [ , style ] ) => {\n\t\t\treturn ! isStyleEmpty( style );\n\t\t} );\n\n\tconst mutatedStyles = Object.fromEntries( entries );\n\n\tcontainer.model.set( 'styles', mutatedStyles );\n\n\treturn mutatedStyles;\n}\n\nfunction removeEmptyVariants( style: StyleDefinition ) {\n\treturn style.variants.filter(\n\t\t( { props, custom_css: customCss } ) => Object.keys( props ).length > 0 || customCss?.raw\n\t);\n}\n\nfunction isStyleEmpty( style: StyleDefinition ) {\n\treturn style.variants.length === 0;\n}\n\nfunction clearRemovedClasses( container: V1Element, { oldIds, newIds }: { oldIds: string[]; newIds: string[] } ) {\n\tconst removedIds = oldIds.filter( ( id ) => ! newIds.includes( id ) );\n\tconst classesProps = structuredClone( getClassesProps( container ) );\n\n\tclassesProps.forEach( ( [ , prop ] ) => {\n\t\tprop.value = prop.value.filter( ( value ) => ! removedIds.includes( value ) );\n\t} );\n\n\tupdateElementSettings( {\n\t\tid: container.id,\n\t\tprops: Object.fromEntries( classesProps ),\n\t\twithHistory: false,\n\t} );\n}\n\nfunction getClassesProps( container: V1Element ) {\n\treturn Object.entries( container.settings.toJSON() ).filter( ( prop ): prop is [ string, ClassesPropValue ] => {\n\t\tconst [ , value ] = prop;\n\n\t\treturn classesPropTypeUtil.isValid( value );\n\t} );\n}\n\nfunction notifyChanges() {\n\tdispatchChangeEvent();\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n}\n\nfunction dispatchChangeEvent() {\n\twindow.dispatchEvent( new CustomEvent( ELEMENT_STYLE_CHANGE_EVENT ) );\n}\n","import { type StyleDefinitionID } from '@elementor/editor-styles';\n\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport function deleteElementStyle( elementId: ElementID, styleId: StyleDefinitionID ) {\n\tmutateElementStyles( elementId, ( styles ) => {\n\t\t// The object is deep cloned so mutating it is fine.\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete styles[ styleId ];\n\n\t\treturn styles;\n\t} );\n}\n","import { mergeProps } from '@elementor/editor-props';\nimport { getVariantByMeta, type StyleDefinition, type StyleDefinitionVariant } from '@elementor/editor-styles';\n\nimport { StyleNotFoundError } from '../errors';\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport type UpdateElementStyleArgs = {\n\telementId: ElementID;\n\tstyleId: StyleDefinition[ 'id' ];\n\tmeta: StyleDefinitionVariant[ 'meta' ];\n\tprops: StyleDefinitionVariant[ 'props' ];\n\tcustom_css?: StyleDefinitionVariant[ 'custom_css' ];\n};\n\nexport function updateElementStyle( args: UpdateElementStyleArgs ) {\n\tmutateElementStyles( args.elementId, ( styles ) => {\n\t\tconst style = styles[ args.styleId ];\n\n\t\tif ( ! style ) {\n\t\t\tthrow new StyleNotFoundError( { context: { styleId: args.styleId } } );\n\t\t}\n\n\t\tconst variant = getVariantByMeta( style, args.meta );\n\t\tconst customCss = ( 'custom_css' in args ? args.custom_css : variant?.custom_css ) ?? null;\n\n\t\tif ( variant ) {\n\t\t\tvariant.props = mergeProps( variant.props, args.props );\n\t\t\tvariant.custom_css = customCss?.raw ? customCss : null;\n\t\t} else {\n\t\t\tstyle.variants.push( { meta: args.meta, props: args.props, custom_css: customCss } );\n\t\t}\n\n\t\treturn styles;\n\t} );\n}\n","import { useState } from 'react';\nimport { __privateUseListenTo as useListenTo, windowEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementInteractions } from '../sync/get-element-interactions';\nimport { type ElementInteractions } from '../sync/types';\nimport { type ElementID } from '../types';\n\nexport const useElementInteractions = ( elementId: ElementID ) => {\n\tconst [ interactions, setInteractions ] = useState< ElementInteractions >( () => {\n\t\tconst initial = getElementInteractions( elementId );\n\n\t\treturn initial ?? { version: 1, items: [] };\n\t} );\n\n\tuseListenTo(\n\t\twindowEvent( 'elementor/element/update_interactions' ),\n\t\t() => {\n\t\t\tconst newInteractions = getElementInteractions( elementId );\n\t\t\tsetInteractions( newInteractions ?? { version: 1, items: [] } );\n\t\t},\n\t\t[ elementId ]\n\t);\n\n\treturn interactions;\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\nimport { type ElementInteractions } from './types';\n\nexport function getElementInteractions( elementId: ElementID ): ElementInteractions | undefined {\n\tconst container = getContainer( elementId );\n\n\tconst interactions = container?.model?.get( 'interactions' );\n\n\tif ( typeof interactions === 'string' ) {\n\t\treturn JSON.parse( interactions ) as ElementInteractions;\n\t}\n\n\treturn interactions;\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1ElementModelProps } from '..';\nimport { getContainer } from './get-container';\n\nexport const updateElementInteractions = ( {\n\telementId,\n\tinteractions,\n}: {\n\telementId: string;\n\tinteractions: V1ElementModelProps[ 'interactions' ];\n} ) => {\n\tconst element = getContainer( elementId );\n\n\tif ( ! element ) {\n\t\tthrow new Error( `Element with id ${ elementId } not found` );\n\t}\n\n\telement.model.set( 'interactions', interactions );\n\n\twindow.dispatchEvent( new CustomEvent( 'elementor/element/update_interactions' ) );\n\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n};\n\nexport const playElementInteractions = ( elementId: string, interactionId: string ) => {\n\twindow.top?.dispatchEvent(\n\t\tnew CustomEvent( 'atomic/play_interactions', { detail: { elementId, interactionId } } )\n\t);\n};\n"],"mappings":";AAAA,SAAS,wBAAwB,aAAa,iBAAiB,oBAAoB;;;ACAnF,SAAS,uBAAuB,kBAAkB;AAI3C,SAAS,aAAc,IAA+B;AAC5D,QAAM,iBAAiB;AACvB,QAAM,YAAY,eAAe,WAAW,eAAgB,EAAG;AAE/D,SAAO,aAAa;AACrB;AAEO,IAAM,gBAAgB,CAAE,cAAuB;AACrD,MAAI;AACH,UAAM,YAAY,aAAc,SAAU;AAE1C,eAAY,4BAA4B,EAAE,UAAU,CAAE;AAAA,EACvD,QAAQ;AAAA,EAAC;AACV;;;ACHO,SAAS,mBAAoB,OAAgB,WAA+D;AAClH,QAAM,cAAgB,MAAM,IAAK,UAAW,KAAK,CAAC;AAElD,aAAY,cAAc,aAAc;AACvC,QAAK,UAAW,UAAW,GAAI;AAC9B,aAAO,EAAE,OAAO,WAAW;AAAA,IAC5B;AAEA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EA,SAAO;AACR;;;ADPO,IAAM,yBAAyB,CAAE,cAA0B;AACjE,QAAM,CAAE,cAAc,eAAgB,IAAI,SAAiC,MAAM;AAChF,UAAM,UAAU,uBAAwB,SAAU;AAElD,WAAO,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC,EAAE;AAAA,EAC3C,CAAE;AAEF,EAAAC;AAAA,IACCC,aAAa,uCAAwC;AAAA,IACrD,MAAM;AACL,YAAM,kBAAkB,uBAAwB,SAAU;AAC1D,sBAAiB,mBAAmB,EAAE,SAAS,GAAG,OAAO,CAAC,EAAE,CAAE;AAAA,IAC/D;AAAA,IACA,CAAE,SAAU;AAAA,EACb;AAEA,SAAO;AACR;;;AExBA,SAAS,2BAA2BC,uBAAsB;AAKnD,IAAM,4BAA4B,CAAE;AAAA,EAC1C;AAAA,EACA;AACD,MAGO;AACN,QAAM,UAAU,aAAc,SAAU;AAExC,MAAK,CAAE,SAAU;AAChB,UAAM,IAAI,MAAO,mBAAoB,SAAU,YAAa;AAAA,EAC7D;AAEA,UAAQ,MAAM,IAAK,gBAAgB,YAAa;AAEhD,SAAO,cAAe,IAAI,YAAa,uCAAwC,CAAE;AAEjF,EAAAC,gBAAgB,iCAAiC,EAAE,QAAQ,KAAK,GAAG,EAAE,UAAU,KAAK,CAAE;AACvF;AAEO,IAAM,0BAA0B,CAAE,WAAmB,kBAA2B;AACtF,SAAO,KAAK;AAAA,IACX,IAAI,YAAa,4BAA4B,EAAE,QAAQ,EAAE,WAAW,cAAc,EAAE,CAAE;AAAA,EACvF;AACD;","names":["useListenTo","useListenTo","useListenTo","commandEndEvent","useListenTo","commandEndEvent","useListenTo","commandEndEvent","useListenTo","commandEndEvent","useListenTo","commandEndEvent","runCommand","runCommandSync","runCommandSync","runCommandSync","undoable","__","__","undoable","undoable","__","__","undoable","undoable","__","__","undoable","runCommandSync","runCommandSync","runCommandSync","runCommandSync","commandEndEvent","windowEvent","classesPropTypeUtil","runCommandSync","runCommandSync","classesPropTypeUtil","useListenTo","windowEvent","useListenTo","windowEvent","runCommandSync","runCommandSync"]}
1
+ {"version":3,"sources":["../src/hooks/use-element-children.ts","../src/sync/get-container.ts","../src/sync/model-utils.ts","../src/hooks/use-element-editor-settings.ts","../src/sync/get-element-editor-settings.ts","../src/hooks/use-element-setting.ts","../src/sync/get-element-setting.ts","../src/hooks/use-parent-element.ts","../src/hooks/use-selected-element.ts","../src/sync/get-widgets-cache.ts","../src/sync/get-element-type.ts","../src/sync/get-selected-elements.ts","../src/sync/create-element.ts","../src/sync/create-elements.ts","../src/sync/delete-element.ts","../src/sync/drop-element.ts","../src/sync/duplicate-element.ts","../src/sync/duplicate-elements.ts","../src/sync/generate-element-id.ts","../src/sync/get-current-document-container.ts","../src/sync/get-current-document-id.ts","../src/errors.ts","../src/sync/get-element-label.ts","../src/sync/get-element-styles.ts","../src/sync/get-all-descendants.ts","../src/sync/get-elements.ts","../src/sync/move-element.ts","../src/sync/move-elements.ts","../src/sync/remove-elements.ts","../src/sync/replace-element.ts","../src/sync/update-element-editor-settings.ts","../src/sync/update-element-settings.ts","../src/link-restriction.ts","../src/styles/consts.ts","../src/styles/create-element-style.ts","../src/styles/mutate-element-styles.ts","../src/styles/delete-element-style.ts","../src/styles/update-element-style.ts","../src/hooks/use-element-interactions.ts","../src/sync/get-element-interactions.ts","../src/sync/update-element-interactions.ts"],"sourcesContent":["import { __privateUseListenTo as useListenTo, commandEndEvent, v1ReadyEvent } from '@elementor/editor-v1-adapters';\n\nimport { getContainer } from '../sync/get-container';\nimport { findChildRecursive, getElementChildren, type ModelResult } from '../sync/model-utils';\nimport { type V1ElementEditorSettingsProps } from '../sync/types';\nimport { type ElementID } from '../types';\n\nexport type ElementModel = {\n\tid: string;\n\teditorSettings: V1ElementEditorSettingsProps;\n};\n\nexport type ElementChildren = Record< string, ElementModel[] >;\n\nfunction toElementModel( { model }: ModelResult ): ElementModel {\n\treturn {\n\t\tid: model.get( 'id' ) as string,\n\t\teditorSettings: model.get( 'editor_settings' ) ?? {},\n\t};\n}\n\nexport function useElementChildren< T extends ElementChildren >(\n\telementId: ElementID,\n\tchildrenTypes: Record< string, string >\n): T {\n\treturn useListenTo(\n\t\t[\n\t\t\tv1ReadyEvent(),\n\t\t\tcommandEndEvent( 'document/elements/create' ),\n\t\t\tcommandEndEvent( 'document/elements/delete' ),\n\t\t\tcommandEndEvent( 'document/elements/update' ),\n\t\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t],\n\t\t() => {\n\t\t\tconst container = getContainer( elementId );\n\t\t\tconst model = container?.model;\n\n\t\t\tif ( ! model ) {\n\t\t\t\treturn {} as ElementChildren;\n\t\t\t}\n\n\t\t\tconst elementChildren = Object.entries( childrenTypes ).reduce( ( acc, [ parentType, childType ] ) => {\n\t\t\t\tconst parent = findChildRecursive( model, ( m ) => m.get( 'elType' ) === parentType );\n\n\t\t\t\tif ( ! parent ) {\n\t\t\t\t\tacc[ childType ] = [];\n\t\t\t\t\treturn acc;\n\t\t\t\t}\n\n\t\t\t\tconst children = getElementChildren( parent.model, ( m ) => m.get( 'elType' ) === childType );\n\n\t\t\t\tacc[ childType ] = children.map( toElementModel );\n\n\t\t\t\treturn acc;\n\t\t\t}, {} as ElementChildren );\n\n\t\t\treturn elementChildren;\n\t\t},\n\t\t[ elementId ]\n\t) as T;\n}\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\n\nimport { type ExtendedWindow, type V1Element } from './types';\n\nexport function getContainer( id: string ): V1Element | null {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\tconst container = extendedWindow.elementor?.getContainer?.( id );\n\n\treturn container ?? null;\n}\n\nexport const selectElement = ( elementId: string ) => {\n\ttry {\n\t\tconst container = getContainer( elementId );\n\n\t\trunCommand( 'document/elements/select', { container } );\n\t} catch {}\n};\n","import { type V1Element } from './types';\n\nexport type V1Model = V1Element[ 'model' ];\n\nexport type V1Collection = V1Model[] & {\n\tremove: ( model: V1Model ) => void;\n\tadd: ( model: V1Model, options?: { at?: number }, silent?: boolean ) => void;\n\tindexOf: ( model: V1Model ) => number;\n};\n\nexport type ModelResult = {\n\tmodel: V1Model;\n};\n\nexport function findChildRecursive( model: V1Model, predicate: ( model: V1Model ) => boolean ): ModelResult | null {\n\tconst childModels = ( model.get( 'elements' ) ?? [] ) as V1Model[];\n\n\tfor ( const childModel of childModels ) {\n\t\tif ( predicate( childModel ) ) {\n\t\t\treturn { model: childModel };\n\t\t}\n\n\t\tconst found = findChildRecursive( childModel, predicate );\n\n\t\tif ( found ) {\n\t\t\treturn found;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function getElementChildren( model: V1Model, predicate?: ( model: V1Model ) => boolean ): ModelResult[] {\n\tconst childModels = ( model.get( 'elements' ) ?? [] ) as V1Model[];\n\n\treturn childModels\n\t\t.filter( ( childModel ) => ! predicate || predicate( childModel ) )\n\t\t.map( ( childModel ) => ( { model: childModel } ) );\n}\n","import { __privateUseListenTo as useListenTo, windowEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementEditorSettings } from '../sync/get-element-editor-settings';\nimport { type ElementID } from '../types';\n\nexport const useElementEditorSettings = ( elementId: ElementID ) => {\n\treturn useListenTo(\n\t\twindowEvent( 'elementor/element/update_editor_settings' ),\n\t\t() => getElementEditorSettings( elementId ),\n\t\t[ elementId ]\n\t);\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport function getElementEditorSettings( elementId: ElementID ) {\n\tconst container = getContainer( elementId );\n\n\treturn container?.model.get( 'editor_settings' ) ?? {};\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementSetting } from '../sync/get-element-setting';\nimport { type ElementID } from '../types';\n\nexport const useElementSetting = < TValue >( elementId: ElementID, settingKey: string ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t() => getElementSetting< TValue >( elementId, settingKey ),\n\t\t[ elementId, settingKey ]\n\t);\n};\n\nexport const useElementSettings = < TValue >( elementId: ElementID, settingKeys: string[] ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/set-settings' ),\n\t\t() =>\n\t\t\tsettingKeys.reduce< Record< string, TValue > >( ( settings, key ) => {\n\t\t\t\tconst value = getElementSetting< TValue >( elementId, key );\n\n\t\t\t\tif ( value !== null ) {\n\t\t\t\t\tsettings[ key ] = value;\n\t\t\t\t}\n\n\t\t\t\treturn settings;\n\t\t\t}, {} ),\n\t\t[ elementId, settingKeys.join( ',' ) ]\n\t);\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport const getElementSetting = < TValue >( elementId: ElementID, settingKey: string ): TValue | null => {\n\tconst container = getContainer( elementId );\n\n\treturn ( container?.settings?.get( settingKey ) as TValue ) ?? null;\n};\n\nexport const getElementSettings = < TValue >(\n\telementId: ElementID,\n\tsettingKey: string[]\n): Record< string, TValue | null > => {\n\treturn Object.fromEntries( settingKey.map( ( key ) => [ key, getElementSetting( elementId, key ) ] ) );\n};\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { type ExtendedWindow } from '../sync/types';\n\nexport function useParentElement( elementId: string | null ) {\n\treturn useListenTo(\n\t\t[ commandEndEvent( 'document/elements/create' ) ],\n\t\t() => {\n\t\t\tif ( ! elementId ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst extendedWindow = window as unknown as ExtendedWindow;\n\t\t\tconst element = extendedWindow?.elementor?.getContainer?.( elementId );\n\t\t\tif ( ! element ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn element.parent;\n\t\t},\n\t\t[ elementId ]\n\t);\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementType } from '../sync/get-element-type';\nimport { getSelectedElements } from '../sync/get-selected-elements';\n\nexport function useSelectedElement() {\n\tconst elements = useListenTo(\n\t\t[\n\t\t\tcommandEndEvent( 'document/elements/select' ),\n\t\t\tcommandEndEvent( 'document/elements/deselect' ),\n\t\t\tcommandEndEvent( 'document/elements/select-all' ),\n\t\t\tcommandEndEvent( 'document/elements/deselect-all' ),\n\t\t],\n\t\tgetSelectedElements\n\t);\n\n\tconst [ element ] = elements;\n\n\tconst elementType = getElementType( element?.type );\n\n\tif ( elements.length !== 1 || ! elementType ) {\n\t\treturn { element: null, elementType: null };\n\t}\n\n\treturn { element, elementType };\n}\n","import { type ExtendedWindow, type V1ElementConfig } from '../sync/types.js';\ntype WidgetsCache< T > = Record< string, T >;\n\nexport function getWidgetsCache< T extends V1ElementConfig >(): WidgetsCache< T > | null {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn ( extendedWindow?.elementor?.widgetsCache as WidgetsCache< T > ) || null;\n}\n","import { type ElementType } from '../types';\nimport { getWidgetsCache } from './get-widgets-cache';\n\nexport function getElementType( type: string ): ElementType | null {\n\tif ( ! type ) {\n\t\treturn null;\n\t}\n\n\tconst widgetsCache = getWidgetsCache();\n\tconst elementType = widgetsCache?.[ type ];\n\n\tif ( ! elementType?.atomic_controls ) {\n\t\treturn null;\n\t}\n\n\tif ( ! elementType?.atomic_props_schema ) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tkey: type,\n\t\tcontrols: elementType.atomic_controls,\n\t\tpropsSchema: elementType.atomic_props_schema,\n\t\tdependenciesPerTargetMapping: elementType.dependencies_per_target_mapping ?? {},\n\t\ttitle: elementType.title,\n\t\tstyleStates: elementType.atomic_style_states ?? [],\n\t\tpseudoStates: elementType.atomic_pseudo_states ?? [],\n\t};\n}\n","import { type Element } from '../types';\nimport { type ExtendedWindow } from './types';\n\nexport function getSelectedElements(): Element[] {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\tconst selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];\n\n\treturn selectedElements.reduce< Element[] >( ( acc, el ) => {\n\t\tconst type = el.model.get( 'widgetType' ) || el.model.get( 'elType' );\n\n\t\tif ( type ) {\n\t\t\tacc.push( {\n\t\t\t\tid: el.model.get( 'id' ),\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\n\t\treturn acc;\n\t}, [] );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element, type V1ElementModelProps, type V1ElementSettingsProps } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tclone?: boolean;\n};\n\nexport type CreateElementParams = {\n\tcontainer: V1Element;\n\tmodel?: Omit< V1ElementModelProps, 'settings' | 'id' > & { settings?: V1ElementSettingsProps; id?: string };\n\toptions?: Options;\n};\n\nexport function createElement( { container, model, options }: CreateElementParams ): V1Element {\n\treturn runCommandSync< V1Element >( 'document/elements/create', {\n\t\tcontainer,\n\t\tmodel,\n\t\toptions: { edit: false, ...options },\n\t} );\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement, type CreateElementParams } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype CreateElementsParams = {\n\telements: CreateElementParams[];\n\ttitle: string;\n\tsubtitle?: string;\n};\n\ntype CreatedElement = {\n\tcontainer: V1Element;\n\tparentContainer: V1Element;\n\tmodel: V1ElementModelProps;\n\toptions?: CreateElementParams[ 'options' ];\n};\n\ntype CreatedElementsResult = {\n\tcreatedElements: CreatedElement[];\n};\n\nexport type { CreateElementsParams, CreatedElement, CreatedElementsResult };\n\nexport const createElements = ( {\n\telements,\n\ttitle,\n\tsubtitle = __( 'Item added', 'elementor' ),\n}: CreateElementsParams ): CreatedElementsResult => {\n\tconst undoableCreate = undoable(\n\t\t{\n\t\t\tdo: ( { elements: elementsParam }: { elements: CreateElementParams[] } ): CreatedElementsResult => {\n\t\t\t\tconst createdElements: CreatedElement[] = [];\n\n\t\t\t\telementsParam.forEach( ( { container, options, ...elementParams } ) => {\n\t\t\t\t\tconst parentContainer = container.lookup?.() ?? container;\n\n\t\t\t\t\tif ( ! parentContainer ) {\n\t\t\t\t\t\tthrow new Error( 'Parent container not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tconst element = createElement( {\n\t\t\t\t\t\tcontainer: parentContainer,\n\t\t\t\t\t\t...elementParams,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tcreatedElements.push( {\n\t\t\t\t\t\tcontainer: element,\n\t\t\t\t\t\tparentContainer,\n\t\t\t\t\t\tmodel: element.model?.toJSON() || {},\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { createdElements };\n\t\t\t},\n\t\t\tundo: ( _: { elements: CreateElementParams[] }, { createdElements }: CreatedElementsResult ) => {\n\t\t\t\t[ ...createdElements ].reverse().forEach( ( { container } ) => {\n\t\t\t\t\tconst freshContainer = container.lookup?.();\n\n\t\t\t\t\tif ( freshContainer ) {\n\t\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elements: CreateElementParams[] },\n\t\t\t\t{ createdElements }: CreatedElementsResult\n\t\t\t): CreatedElementsResult => {\n\t\t\t\tconst newElements: CreatedElement[] = [];\n\n\t\t\t\tcreatedElements.forEach( ( { parentContainer, model, options } ) => {\n\t\t\t\t\tconst freshParent = parentContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshParent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst element = createElement( {\n\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewElements.push( {\n\t\t\t\t\t\tcontainer: element,\n\t\t\t\t\t\tparentContainer: freshParent,\n\t\t\t\t\t\tmodel: element.model.toJSON(),\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { createdElements: newElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableCreate( { elements } );\n};\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n};\n\ntype DeleteElementParams = {\n\tcontainer: V1Element;\n\toptions?: Options;\n};\n\nexport function deleteElement( { container, options = {} }: DeleteElementParams ): Promise< void > {\n\treturn runCommand( 'document/elements/delete', {\n\t\tcontainer,\n\t\toptions,\n\t} );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps, type V1ElementSettingsProps } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tscrollIntoView: boolean;\n};\n\nexport type DropElementParams = {\n\tcontainerId: string;\n\toptions?: Options;\n\tmodel?: Omit< V1ElementModelProps, 'settings' | 'id' > & { settings?: V1ElementSettingsProps; id?: string };\n};\n\nexport function dropElement( { containerId, model, options }: DropElementParams ) {\n\tconst container = getContainer( containerId );\n\n\tif ( ! container ) {\n\t\tthrow new Error( `Container with ID \"${ containerId }\" not found` );\n\t}\n\n\treturn runCommandSync< V1Element >( 'preview/drop', {\n\t\tcontainer,\n\t\tmodel,\n\t\toptions,\n\t} );\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tclone?: boolean;\n};\n\nexport type DuplicateElementParams = {\n\telement: V1Element;\n\toptions?: Options;\n};\n\nexport function duplicateElement( { element, options = {} }: DuplicateElementParams ): V1Element {\n\tconst currentIndex = element.view?._index ?? 0;\n\tconst insertPosition = options.clone !== false ? currentIndex + 1 : undefined;\n\n\treturn runCommandSync< V1Element >( 'document/elements/duplicate', {\n\t\tcontainer: element,\n\t\toptions: { at: insertPosition, edit: false, ...options },\n\t} );\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { duplicateElement } from './duplicate-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype DuplicateElementsParams = {\n\telementIds: string[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonDuplicateElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype DuplicatedElement = {\n\tcontainer: V1Element;\n\tparentContainer: V1Element;\n\tmodel: V1ElementModelProps;\n\tat?: number;\n};\n\ntype DuplicatedElementsResult = {\n\tduplicatedElements: DuplicatedElement[];\n};\n\nexport type { DuplicateElementsParams, DuplicatedElement, DuplicatedElementsResult };\n\nexport const duplicateElements = ( {\n\telementIds,\n\ttitle,\n\tsubtitle = __( 'Item duplicated', 'elementor' ),\n\tonDuplicateElements,\n\tonRestoreElements,\n}: DuplicateElementsParams ): DuplicatedElementsResult => {\n\tconst undoableDuplicate = undoable(\n\t\t{\n\t\t\tdo: ( { elementIds: elementIdsToDuplicate }: { elementIds: string[] } ): DuplicatedElementsResult => {\n\t\t\t\tonDuplicateElements?.();\n\t\t\t\tconst duplicatedElements: DuplicatedElement[] = [];\n\n\t\t\t\telementIdsToDuplicate.forEach( ( elementId ) => {\n\t\t\t\t\tconst originalContainer = getContainer( elementId );\n\n\t\t\t\t\tif ( ! originalContainer?.parent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst duplicatedElement = duplicateElement( {\n\t\t\t\t\t\telement: originalContainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( ! duplicatedElement.parent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tduplicatedElements.push( {\n\t\t\t\t\t\tcontainer: duplicatedElement,\n\t\t\t\t\t\tparentContainer: duplicatedElement.parent,\n\t\t\t\t\t\tmodel: duplicatedElement.model.toJSON(),\n\t\t\t\t\t\tat: duplicatedElement.view?._index,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { duplicatedElements };\n\t\t\t},\n\t\t\tundo: ( _: { elementIds: string[] }, { duplicatedElements }: DuplicatedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\t\t\t\t[ ...duplicatedElements ].reverse().forEach( ( { container } ) => {\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elementIds: string[] },\n\t\t\t\t{ duplicatedElements: previousElements }: DuplicatedElementsResult\n\t\t\t): DuplicatedElementsResult => {\n\t\t\t\tonDuplicateElements?.();\n\t\t\t\tconst duplicatedElements: DuplicatedElement[] = [];\n\n\t\t\t\tpreviousElements.forEach( ( { parentContainer, model, at } ) => {\n\t\t\t\t\tconst freshParent = parentContainer.lookup?.();\n\n\t\t\t\t\tif ( freshParent ) {\n\t\t\t\t\t\tconst createdElement = createElement( {\n\t\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\toptions: { useHistory: false, clone: false, at },\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tduplicatedElements.push( {\n\t\t\t\t\t\t\tcontainer: createdElement,\n\t\t\t\t\t\t\tparentContainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\tat,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\treturn { duplicatedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableDuplicate( { elementIds } );\n};\n","import { type ExtendedWindow } from './types';\n\nexport const generateElementId = () => {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn (\n\t\textendedWindow.elementorCommon?.helpers?.getUniqueId?.() ??\n\t\t`el-${ Date.now() }-${ Math.random().toString( 36 ).substring( 2, 9 ) }`\n\t);\n};\n","import { type ExtendedWindow } from './types';\n\nexport function getCurrentDocumentContainer() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.documents?.getCurrent?.()?.container ?? null;\n}\n","import { type ExtendedWindow } from './types';\n\nexport function getCurrentDocumentId() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.documents?.getCurrentId?.() ?? null;\n}\n","import { createError } from '@elementor/utils';\n\nexport const ElementNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_not_found',\n\tmessage: 'Element not found.',\n} );\n\nexport const StyleNotFoundError = createError< { styleId: string } >( {\n\tcode: 'style_not_found',\n\tmessage: 'Style not found.',\n} );\n\nexport const ElementTypeNotExistsError = createError< { elementId: string } >( {\n\tcode: 'element_type_not_exists',\n\tmessage: 'Element type does not exist.',\n} );\n\nexport const ElementLabelNotExistsError = createError< { elementType: string } >( {\n\tcode: 'element_label_not_exists',\n\tmessage: 'Element label does not exist.',\n} );\n\nexport const ElementParentNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_parent_not_found',\n\tmessage: 'Element parent not found.',\n} );\n\nexport const ElementIndexNotFoundError = createError< { elementId: string } >( {\n\tcode: 'element_index_not_found',\n\tmessage: 'Element index not found.',\n} );\n","import { ElementLabelNotExistsError, ElementTypeNotExistsError } from '../errors';\nimport { getContainer } from '../sync/get-container';\nimport { getWidgetsCache } from '../sync/get-widgets-cache';\nimport { type ElementID } from '../types';\nimport { getSelectedElements } from './get-selected-elements';\n\nexport function getElementLabel( elementId?: ElementID ) {\n\tif ( ! elementId ) {\n\t\telementId = getSelectedElements()?.[ 0 ]?.id;\n\t}\n\n\tconst container = getContainer( elementId );\n\n\tconst type = container?.model.get( 'widgetType' ) || container?.model.get( 'elType' );\n\n\tif ( ! type ) {\n\t\tthrow new ElementTypeNotExistsError( { context: { elementId } } );\n\t}\n\n\tconst label = getWidgetsCache()?.[ type ]?.title;\n\n\tif ( ! label ) {\n\t\tthrow new ElementLabelNotExistsError( { context: { elementType: type } } );\n\t}\n\n\treturn label;\n}\n","import { type StyleDefinition } from '@elementor/editor-styles';\n\nimport { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport const getElementStyles = ( elementID: ElementID ): Record< string, StyleDefinition > | null => {\n\tconst container = getContainer( elementID );\n\n\treturn container?.model.get( 'styles' ) || null;\n};\n","import { type V1Element } from './types';\n\nexport function getAllDescendants( container: V1Element ): V1Element[] {\n\tconst children = ( container.children ?? [] ).flatMap( ( child ) => getAllDescendants( child as V1Element ) );\n\n\treturn [ container, ...children ];\n}\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\nimport { getCurrentDocumentContainer } from './get-current-document-container';\nimport { type V1Element } from './types';\n\nexport function getElements( root?: ElementID ): V1Element[] {\n\tconst container = root ? getContainer( root ) : getCurrentDocumentContainer();\n\n\tif ( ! container ) {\n\t\treturn [];\n\t}\n\n\tconst children = [ ...( container.model.get( 'elements' ) ?? [] ) ].flatMap( ( childModel ) =>\n\t\tgetElements( childModel.get( 'id' ) )\n\t);\n\n\treturn [ container, ...children ];\n}\n","import { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { type V1Element } from './types';\n\ntype Options = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tedit?: boolean;\n};\n\nexport type MoveElementParams = {\n\telement: V1Element;\n\ttargetContainer: V1Element;\n\toptions?: Options;\n};\n\nexport function moveElement( { element, targetContainer, options = {} }: MoveElementParams ): V1Element {\n\tconst resolvedElement = element.lookup?.();\n\tconst resolvedTarget = targetContainer.lookup?.();\n\n\tif ( ! resolvedElement ) {\n\t\tthrow new Error( `Element not found: ${ element.id }` );\n\t}\n\n\tif ( ! resolvedTarget ) {\n\t\tthrow new Error( `Target container not found: ${ targetContainer.id }` );\n\t}\n\n\tconst modelToRecreate = resolvedElement.model.toJSON();\n\n\tdeleteElement( {\n\t\tcontainer: resolvedElement,\n\t\toptions: { ...options, useHistory: false },\n\t} );\n\n\tconst newContainer = createElement( {\n\t\tcontainer: resolvedTarget,\n\t\tmodel: modelToRecreate,\n\t\toptions: { edit: false, ...options, useHistory: false },\n\t} );\n\n\treturn newContainer;\n}\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { moveElement } from './move-element';\nimport { type V1Element } from './types';\n\ntype MoveOptions = {\n\tuseHistory?: boolean;\n\tat?: number;\n\tedit?: boolean;\n};\n\ntype MoveInput = {\n\telement: V1Element;\n\ttargetContainer: V1Element;\n\toptions?: MoveOptions;\n};\n\ntype MoveElementsParams = {\n\tmoves: MoveInput[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonMoveElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype MovedElement = {\n\telement: V1Element;\n\toriginalContainer: V1Element;\n\toriginalIndex: number;\n\ttargetContainer: V1Element;\n\toptions?: MoveOptions;\n};\n\ntype MovedElementsResult = {\n\tmovedElements: MovedElement[];\n};\n\nexport type { MoveElementsParams, MoveInput, MovedElement, MovedElementsResult };\n\nexport const moveElements = ( {\n\tmoves: movesToMake,\n\ttitle,\n\tsubtitle = __( 'Elements moved', 'elementor' ),\n\tonMoveElements,\n\tonRestoreElements,\n}: MoveElementsParams ): MovedElementsResult => {\n\tconst undoableMove = undoable(\n\t\t{\n\t\t\tdo: ( { moves }: { moves: MoveInput[] } ): MovedElementsResult => {\n\t\t\t\tconst movedElements: MovedElement[] = [];\n\t\t\t\tonMoveElements?.();\n\n\t\t\t\tmoves.forEach( ( { element, targetContainer, options } ) => {\n\t\t\t\t\tconst sourceElement = element.lookup?.() ?? element;\n\t\t\t\t\tconst target = targetContainer.lookup?.() ?? targetContainer;\n\n\t\t\t\t\tif ( ! sourceElement ) {\n\t\t\t\t\t\tthrow new Error( 'Element not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! target ) {\n\t\t\t\t\t\tthrow new Error( 'Target container not found' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! sourceElement.parent ) {\n\t\t\t\t\t\tthrow new Error( 'Element has no parent container' );\n\t\t\t\t\t}\n\n\t\t\t\t\tconst originalContainer = sourceElement.parent;\n\t\t\t\t\tconst originalIndex = originalContainer.children?.indexOf( sourceElement ) ?? -1;\n\n\t\t\t\t\tconst newElement = moveElement( {\n\t\t\t\t\t\telement: sourceElement,\n\t\t\t\t\t\ttargetContainer: target,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tmovedElements.push( {\n\t\t\t\t\t\telement: newElement,\n\t\t\t\t\t\toriginalContainer,\n\t\t\t\t\t\toriginalIndex,\n\t\t\t\t\t\ttargetContainer: target,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { movedElements };\n\t\t\t},\n\t\t\tundo: ( _: { moves: MoveInput[] }, { movedElements }: MovedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\n\t\t\t\t[ ...movedElements ].reverse().forEach( ( { element, originalContainer, originalIndex } ) => {\n\t\t\t\t\tconst freshElement = element.lookup?.();\n\t\t\t\t\tconst freshOriginalContainer = originalContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshElement || ! freshOriginalContainer ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveElement( {\n\t\t\t\t\t\telement: freshElement,\n\t\t\t\t\t\ttargetContainer: freshOriginalContainer,\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tuseHistory: false,\n\t\t\t\t\t\t\tat: originalIndex >= 0 ? originalIndex : undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: ( _: { moves: MoveInput[] }, { movedElements }: MovedElementsResult ): MovedElementsResult => {\n\t\t\t\tconst newMovedElements: MovedElement[] = [];\n\t\t\t\tonMoveElements?.();\n\n\t\t\t\tmovedElements.forEach( ( { element, originalContainer, originalIndex, targetContainer, options } ) => {\n\t\t\t\t\tconst freshElement = element.lookup?.();\n\t\t\t\t\tconst freshOriginalContainer = originalContainer.lookup?.();\n\t\t\t\t\tconst freshTarget = targetContainer.lookup?.();\n\n\t\t\t\t\tif ( ! freshElement || ! freshOriginalContainer || ! freshTarget ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst newElement = moveElement( {\n\t\t\t\t\t\telement: freshElement,\n\t\t\t\t\t\ttargetContainer: freshTarget,\n\t\t\t\t\t\toptions: { ...options, useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewMovedElements.push( {\n\t\t\t\t\t\telement: newElement,\n\t\t\t\t\t\toriginalContainer: freshOriginalContainer,\n\t\t\t\t\t\toriginalIndex,\n\t\t\t\t\t\ttargetContainer: freshTarget,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { movedElements: newMovedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableMove( { moves: movesToMake } );\n};\n","import { undoable } from '@elementor/editor-v1-adapters';\nimport { __ } from '@wordpress/i18n';\n\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementModelProps } from './types';\n\ntype RemoveElementsParams = {\n\telementIds: string[];\n\ttitle: string;\n\tsubtitle?: string;\n\tonRemoveElements?: () => void;\n\tonRestoreElements?: () => void;\n};\n\ntype RemovedElement = {\n\tcontainer: V1Element;\n\tparent: V1Element;\n\tmodel: V1ElementModelProps;\n\tat: number;\n};\n\ntype RemovedElementsResult = {\n\tremovedElements: RemovedElement[];\n};\n\nexport const removeElements = ( {\n\telementIds,\n\ttitle,\n\tsubtitle = __( 'Item removed', 'elementor' ),\n\tonRemoveElements,\n\tonRestoreElements,\n}: RemoveElementsParams ): RemovedElementsResult => {\n\tconst undoableRemove = undoable(\n\t\t{\n\t\t\tdo: ( { elementIds: elementIdsParam }: { elementIds: string[] } ): RemovedElementsResult => {\n\t\t\t\tconst removedElements: RemovedElement[] = [];\n\n\t\t\t\telementIdsParam.forEach( ( elementId ) => {\n\t\t\t\t\tconst container = getContainer( elementId );\n\n\t\t\t\t\tif ( container?.parent ) {\n\t\t\t\t\t\tremovedElements.push( {\n\t\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\t\tparent: container.parent,\n\t\t\t\t\t\t\tmodel: container.model.toJSON(),\n\t\t\t\t\t\t\tat: container.view?._index ?? 0,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tonRemoveElements?.();\n\n\t\t\t\tremovedElements.forEach( ( { container } ) => {\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { removedElements };\n\t\t\t},\n\t\t\tundo: ( _: { elementIds: string[] }, { removedElements }: RemovedElementsResult ) => {\n\t\t\t\tonRestoreElements?.();\n\n\t\t\t\t[ ...removedElements ].reverse().forEach( ( { parent, model, at } ) => {\n\t\t\t\t\tconst freshParent = parent.lookup?.();\n\n\t\t\t\t\tif ( freshParent ) {\n\t\t\t\t\t\tcreateElement( {\n\t\t\t\t\t\t\tcontainer: freshParent,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\toptions: { useHistory: false, at },\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\tredo: (\n\t\t\t\t_: { elementIds: string[] },\n\t\t\t\t{ removedElements }: RemovedElementsResult\n\t\t\t): RemovedElementsResult => {\n\t\t\t\tonRemoveElements?.();\n\n\t\t\t\tconst newRemovedElements: RemovedElement[] = [];\n\n\t\t\t\tremovedElements.forEach( ( { container, parent, model, at } ) => {\n\t\t\t\t\tconst freshContainer = container.lookup?.();\n\t\t\t\t\tconst freshParent = parent.lookup?.();\n\n\t\t\t\t\tif ( ! freshContainer || ! freshParent ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdeleteElement( {\n\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\toptions: { useHistory: false },\n\t\t\t\t\t} );\n\n\t\t\t\t\tnewRemovedElements.push( {\n\t\t\t\t\t\tcontainer: freshContainer,\n\t\t\t\t\t\tparent: freshParent,\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\tat,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\treturn { removedElements: newRemovedElements };\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle,\n\t\t\tsubtitle,\n\t\t}\n\t);\n\n\treturn undoableRemove( { elementIds } );\n};\n","import { ElementIndexNotFoundError, ElementNotFoundError, ElementParentNotFoundError } from '../errors';\nimport { createElement } from './create-element';\nimport { deleteElement } from './delete-element';\nimport { getContainer } from './get-container';\nimport { type V1Element, type V1ElementData, type V1ElementModelProps } from './types';\n\ntype ElementLocation = {\n\tcontainer: V1Element;\n\tindex: number;\n};\n\ntype ReplaceElementArgs = {\n\tcurrentElement: V1ElementData;\n\tnewElement: Omit< V1ElementModelProps, 'id' >;\n\twithHistory?: boolean;\n};\n\nexport const replaceElement = async ( { currentElement, newElement, withHistory = true }: ReplaceElementArgs ) => {\n\tconst currentElementContainer = getContainer( currentElement.id );\n\n\tif ( ! currentElementContainer ) {\n\t\tthrow new ElementNotFoundError( { context: { elementId: currentElement.id } } );\n\t}\n\n\tconst { container, index } = getNewElementContainer( currentElementContainer, newElement );\n\n\tconst newElementInstance = createElement( {\n\t\tcontainer,\n\t\tmodel: newElement,\n\t\toptions: { at: index, useHistory: withHistory },\n\t} );\n\n\tawait deleteElement( { container: currentElementContainer, options: { useHistory: withHistory } } );\n\n\treturn newElementInstance;\n};\n\nfunction getNewElementContainer(\n\tcurrentElementContainer: V1Element,\n\tnewElement: Omit< V1ElementModelProps, 'id' >\n): ElementLocation {\n\tconst { parent } = currentElementContainer;\n\n\tif ( ! parent ) {\n\t\tthrow new ElementParentNotFoundError( { context: { elementId: currentElementContainer.id } } );\n\t}\n\n\tconst elementIndex = currentElementContainer.view?._index ?? 0;\n\n\tif ( elementIndex === -1 ) {\n\t\tthrow new ElementIndexNotFoundError( { context: { elementId: currentElementContainer.id } } );\n\t}\n\n\tlet location: ElementLocation = { container: parent, index: elementIndex };\n\n\tif ( parent.id === 'document' && newElement.elType === 'widget' ) {\n\t\tlocation = createWrapperForWidget( parent, elementIndex );\n\t}\n\n\treturn location;\n}\n\nconst DEFAULT_CONTAINER_TYPE = 'e-flexbox';\n\nfunction createWrapperForWidget( parent: V1Element, elementIndex: number ): ElementLocation {\n\tconst container = createElement( {\n\t\tcontainer: parent,\n\t\tmodel: { elType: DEFAULT_CONTAINER_TYPE },\n\t\toptions: { at: elementIndex, useHistory: false },\n\t} );\n\n\treturn { container, index: 0 };\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1ElementModelProps } from '..';\nimport { getContainer } from './get-container';\n\nexport const updateElementEditorSettings = ( {\n\telementId,\n\tsettings,\n}: {\n\telementId: string;\n\tsettings: V1ElementModelProps[ 'editor_settings' ];\n} ) => {\n\tconst element = getContainer( elementId );\n\n\tif ( ! element ) {\n\t\tthrow new Error( `Element with id ${ elementId } not found` );\n\t}\n\n\tconst editorSettings = element.model.get( 'editor_settings' ) ?? {};\n\n\telement.model.set( 'editor_settings', { ...editorSettings, ...settings } );\n\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n};\n","import { type Props } from '@elementor/editor-props';\nimport { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type ElementID } from '../types';\nimport { getContainer } from './get-container';\n\nexport type UpdateElementSettingsArgs = {\n\tid: ElementID;\n\tprops: Props;\n\twithHistory?: boolean;\n};\n\nexport const updateElementSettings = ( { id, props, withHistory = true }: UpdateElementSettingsArgs ) => {\n\tconst container = getContainer( id );\n\n\tif ( ! container ) {\n\t\treturn;\n\t}\n\n\tconst args = {\n\t\tcontainer,\n\t\tsettings: { ...props },\n\t};\n\n\tif ( withHistory ) {\n\t\trunCommandSync( 'document/elements/settings', args );\n\t} else {\n\t\trunCommandSync( 'document/elements/set-settings', args, { internal: true } );\n\t}\n};\n","import { type LinkPropValue } from '@elementor/editor-props';\n\nimport { getContainer } from './sync/get-container';\nimport { getElementSetting } from './sync/get-element-setting';\n\nconst ANCHOR_SELECTOR = 'a, [data-action-link]';\n\ntype LinkValue = LinkPropValue[ 'value' ];\n\nexport type LinkInLinkRestriction =\n\t| {\n\t\t\tshouldRestrict: true;\n\t\t\treason: 'ancestor' | 'descendant';\n\t\t\telementId: string | null;\n\t }\n\t| {\n\t\t\tshouldRestrict: false;\n\t\t\treason?: never;\n\t\t\telementId?: never;\n\t };\n\nexport function getLinkInLinkRestriction( elementId: string, resolvedValue?: LinkValue ): LinkInLinkRestriction {\n\tconst anchoredDescendantId = getAnchoredDescendantId( elementId );\n\n\tif ( anchoredDescendantId ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'descendant',\n\t\t\telementId: anchoredDescendantId,\n\t\t};\n\t}\n\n\tconst hasInlineLink = checkForInlineLink( elementId, resolvedValue );\n\n\tif ( hasInlineLink ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'descendant',\n\t\t\telementId,\n\t\t};\n\t}\n\n\tconst ancestor = getAnchoredAncestorId( elementId );\n\n\tif ( ancestor ) {\n\t\treturn {\n\t\t\tshouldRestrict: true,\n\t\t\treason: 'ancestor',\n\t\t\telementId: ancestor,\n\t\t};\n\t}\n\n\treturn {\n\t\tshouldRestrict: false,\n\t};\n}\n\nexport function getAnchoredDescendantId( elementId: string ): string | null {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element ) {\n\t\treturn null;\n\t}\n\n\tfor ( const childAnchorElement of Array.from( element.querySelectorAll( ANCHOR_SELECTOR ) ) ) {\n\t\t// Ensure the child is not in the current element's scope\n\t\tconst childElementId = findElementIdOf( childAnchorElement );\n\n\t\tif ( childElementId !== elementId ) {\n\t\t\treturn childElementId;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function getAnchoredAncestorId( elementId: string ): string | null {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element || element.parentElement === null ) {\n\t\treturn null;\n\t}\n\n\tconst parentAnchor = element.parentElement.closest( ANCHOR_SELECTOR );\n\n\treturn parentAnchor ? findElementIdOf( parentAnchor ) : null;\n}\n\nexport function isElementAnchored( elementId: string ): boolean {\n\tconst element = getElementDOM( elementId ) as HTMLElement;\n\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tif ( element.matches( ANCHOR_SELECTOR ) ) {\n\t\treturn true;\n\t}\n\n\treturn doesElementContainAnchor( element );\n}\n\nfunction doesElementContainAnchor( element: Element ): boolean {\n\tfor ( const child of Array.from( element.children ) as HTMLElement[] ) {\n\t\tif ( isElementorElement( child ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( child.matches( ANCHOR_SELECTOR ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( doesElementContainAnchor( child ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nfunction findElementIdOf( element: Element ): string | null {\n\treturn element.closest< HTMLElement >( '[data-id]' )?.dataset.id || null;\n}\n\nfunction checkForInlineLink( elementId: string, resolvedValue?: LinkValue ): boolean {\n\tconst element = getElementDOM( elementId );\n\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tif ( element.matches( ANCHOR_SELECTOR ) ) {\n\t\treturn false;\n\t}\n\n\tconst linkSetting = resolvedValue ?? getElementSetting< LinkPropValue >( elementId, 'link' )?.value;\n\n\tif ( linkSetting?.destination ) {\n\t\treturn false;\n\t}\n\n\treturn element.querySelector( ANCHOR_SELECTOR ) !== null;\n}\n\nfunction getElementDOM( id: string ) {\n\ttry {\n\t\treturn getContainer( id )?.view?.el || null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction isElementorElement( element: Element ): boolean {\n\treturn element.hasAttribute( 'data-id' );\n}\n","import { commandEndEvent, windowEvent } from '@elementor/editor-v1-adapters';\n\nexport const ELEMENT_STYLE_CHANGE_EVENT = 'elementor/editor-v2/editor-elements/style';\n\nexport const styleRerenderEvents = [\n\tcommandEndEvent( 'document/elements/create' ),\n\tcommandEndEvent( 'document/elements/duplicate' ),\n\tcommandEndEvent( 'document/elements/import' ),\n\tcommandEndEvent( 'document/elements/paste' ),\n\twindowEvent( ELEMENT_STYLE_CHANGE_EVENT ),\n];\n","import { classesPropTypeUtil } from '@elementor/editor-props';\nimport {\n\tgenerateId,\n\ttype StyleDefinition,\n\ttype StyleDefinitionID,\n\ttype StyleDefinitionVariant,\n} from '@elementor/editor-styles';\n\nimport { getElementSetting } from '../sync/get-element-setting';\nimport { updateElementSettings } from '../sync/update-element-settings';\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport type CreateElementStyleArgs = {\n\tstyleId?: StyleDefinitionID;\n\telementId: ElementID;\n\tclassesProp: string;\n\tlabel: string;\n\tmeta: StyleDefinitionVariant[ 'meta' ];\n\tprops: StyleDefinitionVariant[ 'props' ];\n\tcustom_css?: StyleDefinitionVariant[ 'custom_css' ];\n\tadditionalVariants?: StyleDefinitionVariant[];\n};\n\nexport function createElementStyle( {\n\tstyleId,\n\telementId,\n\tclassesProp,\n\tlabel,\n\tmeta,\n\tprops,\n\tcustom_css: customCss = null,\n\tadditionalVariants = [],\n}: CreateElementStyleArgs ): string {\n\tlet id = styleId;\n\n\tmutateElementStyles( elementId, ( styles ) => {\n\t\tid ??= generateId( `e-${ elementId }-`, Object.keys( styles ) );\n\n\t\tconst variants = [ { meta, props, custom_css: customCss }, ...additionalVariants ];\n\n\t\tstyles[ id ] = {\n\t\t\tid,\n\t\t\tlabel,\n\t\t\ttype: 'class',\n\t\t\tvariants,\n\t\t} satisfies StyleDefinition;\n\n\t\taddStyleToClassesProp( elementId, classesProp, id );\n\n\t\treturn styles;\n\t} );\n\n\treturn id as string;\n}\n\nfunction addStyleToClassesProp( elementId: ElementID, classesProp: string, styleId: string ) {\n\tconst base = getElementSetting( elementId, classesProp );\n\n\tconst classesPropValue = classesPropTypeUtil.create(\n\t\t( prev ) => {\n\t\t\treturn [ ...( prev ?? [] ), styleId ];\n\t\t},\n\t\t{ base }\n\t);\n\n\tupdateElementSettings( {\n\t\tid: elementId,\n\t\tprops: {\n\t\t\t[ classesProp ]: classesPropValue,\n\t\t},\n\t\twithHistory: false,\n\t} );\n}\n\nexport function shouldCreateNewLocalStyle< T >(\n\tpayload: { styleId: StyleDefinition[ 'id' ] | null; provider: T | null } | null\n) {\n\treturn ! payload?.styleId && ! payload?.provider;\n}\n","import { classesPropTypeUtil, type ClassesPropValue } from '@elementor/editor-props';\nimport { type StyleDefinition, type StyleDefinitionsMap } from '@elementor/editor-styles';\nimport { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { ElementNotFoundError } from '../errors';\nimport { getContainer } from '../sync/get-container';\nimport { type V1Element } from '../sync/types';\nimport { updateElementSettings } from '../sync/update-element-settings';\nimport { type ElementID } from '../types';\nimport { ELEMENT_STYLE_CHANGE_EVENT } from './consts';\n\ntype Mutator = ( styles: StyleDefinitionsMap ) => StyleDefinitionsMap;\n\nexport function mutateElementStyles( elementId: ElementID, mutator: Mutator ) {\n\tconst container = getContainer( elementId );\n\n\tif ( ! container ) {\n\t\tthrow new ElementNotFoundError( { context: { elementId } } );\n\t}\n\n\tconst oldIds = Object.keys( container.model.get( 'styles' ) ?? {} );\n\n\tconst styles = mutateStyles( container, mutator );\n\n\tconst newIds = Object.keys( styles );\n\n\tclearRemovedClasses( container, {\n\t\toldIds,\n\t\tnewIds,\n\t} );\n\n\tnotifyChanges();\n\n\treturn styles;\n}\n\nfunction mutateStyles( container: V1Element, mutator: Mutator ) {\n\tconst styles: StyleDefinitionsMap = structuredClone( container.model.get( 'styles' ) ) ?? {};\n\n\tconst entries = Object.entries( mutator( styles ) )\n\t\t.map( ( [ styleId, style ] ) => {\n\t\t\tstyle.variants = removeEmptyVariants( style );\n\n\t\t\treturn [ styleId, style ] as const;\n\t\t} )\n\t\t.filter( ( [ , style ] ) => {\n\t\t\treturn ! isStyleEmpty( style );\n\t\t} );\n\n\tconst mutatedStyles = Object.fromEntries( entries );\n\n\tcontainer.model.set( 'styles', mutatedStyles );\n\n\treturn mutatedStyles;\n}\n\nfunction removeEmptyVariants( style: StyleDefinition ) {\n\treturn style.variants.filter(\n\t\t( { props, custom_css: customCss } ) => Object.keys( props ).length > 0 || customCss?.raw\n\t);\n}\n\nfunction isStyleEmpty( style: StyleDefinition ) {\n\treturn style.variants.length === 0;\n}\n\nfunction clearRemovedClasses( container: V1Element, { oldIds, newIds }: { oldIds: string[]; newIds: string[] } ) {\n\tconst removedIds = oldIds.filter( ( id ) => ! newIds.includes( id ) );\n\tconst classesProps = structuredClone( getClassesProps( container ) );\n\n\tclassesProps.forEach( ( [ , prop ] ) => {\n\t\tprop.value = prop.value.filter( ( value ) => ! removedIds.includes( value ) );\n\t} );\n\n\tupdateElementSettings( {\n\t\tid: container.id,\n\t\tprops: Object.fromEntries( classesProps ),\n\t\twithHistory: false,\n\t} );\n}\n\nfunction getClassesProps( container: V1Element ) {\n\treturn Object.entries( container.settings.toJSON() ).filter( ( prop ): prop is [ string, ClassesPropValue ] => {\n\t\tconst [ , value ] = prop;\n\n\t\treturn classesPropTypeUtil.isValid( value );\n\t} );\n}\n\nfunction notifyChanges() {\n\tdispatchChangeEvent();\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n}\n\nfunction dispatchChangeEvent() {\n\twindow.dispatchEvent( new CustomEvent( ELEMENT_STYLE_CHANGE_EVENT ) );\n}\n","import { type StyleDefinitionID } from '@elementor/editor-styles';\n\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport function deleteElementStyle( elementId: ElementID, styleId: StyleDefinitionID ) {\n\tmutateElementStyles( elementId, ( styles ) => {\n\t\t// The object is deep cloned so mutating it is fine.\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete styles[ styleId ];\n\n\t\treturn styles;\n\t} );\n}\n","import { mergeProps } from '@elementor/editor-props';\nimport { getVariantByMeta, type StyleDefinition, type StyleDefinitionVariant } from '@elementor/editor-styles';\n\nimport { StyleNotFoundError } from '../errors';\nimport { type ElementID } from '../types';\nimport { mutateElementStyles } from './mutate-element-styles';\n\nexport type UpdateElementStyleArgs = {\n\telementId: ElementID;\n\tstyleId: StyleDefinition[ 'id' ];\n\tmeta: StyleDefinitionVariant[ 'meta' ];\n\tprops: StyleDefinitionVariant[ 'props' ];\n\tcustom_css?: StyleDefinitionVariant[ 'custom_css' ];\n};\n\nexport function updateElementStyle( args: UpdateElementStyleArgs ) {\n\tmutateElementStyles( args.elementId, ( styles ) => {\n\t\tconst style = styles[ args.styleId ];\n\n\t\tif ( ! style ) {\n\t\t\tthrow new StyleNotFoundError( { context: { styleId: args.styleId } } );\n\t\t}\n\n\t\tconst variant = getVariantByMeta( style, args.meta );\n\t\tconst customCss = ( 'custom_css' in args ? args.custom_css : variant?.custom_css ) ?? null;\n\n\t\tif ( variant ) {\n\t\t\tvariant.props = mergeProps( variant.props, args.props );\n\t\t\tvariant.custom_css = customCss?.raw ? customCss : null;\n\t\t} else {\n\t\t\tstyle.variants.push( { meta: args.meta, props: args.props, custom_css: customCss } );\n\t\t}\n\n\t\treturn styles;\n\t} );\n}\n","import { useState } from 'react';\nimport { __privateUseListenTo as useListenTo, windowEvent } from '@elementor/editor-v1-adapters';\n\nimport { getElementInteractions } from '../sync/get-element-interactions';\nimport { type ElementInteractions } from '../sync/types';\nimport { type ElementID } from '../types';\n\nexport const useElementInteractions = ( elementId: ElementID ) => {\n\tconst [ interactions, setInteractions ] = useState< ElementInteractions >( () => {\n\t\tconst initial = getElementInteractions( elementId );\n\n\t\treturn initial ?? { version: 1, items: [] };\n\t} );\n\n\tuseListenTo(\n\t\twindowEvent( 'elementor/element/update_interactions' ),\n\t\t() => {\n\t\t\tconst newInteractions = getElementInteractions( elementId );\n\t\t\tsetInteractions( newInteractions ?? { version: 1, items: [] } );\n\t\t},\n\t\t[ elementId ]\n\t);\n\n\treturn interactions;\n};\n","import { type ElementID } from '../types';\nimport { getContainer } from './get-container';\nimport { type ElementInteractions } from './types';\n\nexport function getElementInteractions( elementId: ElementID ): ElementInteractions | undefined {\n\tconst container = getContainer( elementId );\n\n\tconst interactions = container?.model?.get( 'interactions' );\n\n\tif ( typeof interactions === 'string' ) {\n\t\treturn JSON.parse( interactions ) as ElementInteractions;\n\t}\n\n\treturn interactions;\n}\n","import { __privateRunCommandSync as runCommandSync } from '@elementor/editor-v1-adapters';\n\nimport { type V1ElementModelProps } from '..';\nimport { getContainer } from './get-container';\n\nexport const updateElementInteractions = ( {\n\telementId,\n\tinteractions,\n}: {\n\telementId: string;\n\tinteractions: V1ElementModelProps[ 'interactions' ];\n} ) => {\n\tconst element = getContainer( elementId );\n\n\tif ( ! element ) {\n\t\tthrow new Error( `Element with id ${ elementId } not found` );\n\t}\n\n\telement.model.set( 'interactions', interactions );\n\n\twindow.dispatchEvent( new CustomEvent( 'elementor/element/update_interactions' ) );\n\n\trunCommandSync( 'document/save/set-is-modified', { status: true }, { internal: true } );\n};\n\nexport const playElementInteractions = ( elementId: string, interactionId: string ) => {\n\twindow.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U;AAChB,UAAM,IAAI,MAAO,mBAAoB,SAAU,YAAa;AAAA,EAC7D;AAEA,UAAQ,MAAM,IAAK,gBAAgB,YAAa;AAEhD,SAAO,cAAe,IAAI,YAAa,uCAAwC,CAAE;AAEjF,EAAAC,gBAAgB,iCAAiC,EAAE,QAAQ,KAAK,GAAG,EAAE,UAAU,KAAK,CAAE;AACvF;AAEO,IAAM,0BAA0B,CAAE,WAAmB,kBAA2B;AACtF,SAAO,KAAK;AAAA,IACX,IAAI,YAAa,4BAA4B,EAAE,QAAQ,EAAE,WAAW,cAAc,EAAE,CAAE;AAAA,EACvF;AACD;","names":["useListenTo","useListenTo","useListenTo","commandEndEvent","useListenTo","commandEndEvent","useListenTo","commandEndEvent","useListenTo","commandEndEvent","useListenTo","commandEndEvent","runCommand","runCommandSync","runCommandSync","runCommandSync","undoable","__","__","undoable","undoable","__","__","undoable","undoable","__","__","undoable","runCommandSync","runCommandSync","runCommandSync","runCommandSync","commandEndEvent","windowEvent","classesPropTypeUtil","runCommandSync","runCommandSync","classesPropTypeUtil","useListenTo","windowEvent","useListenTo","windowEvent","runCommandSync","runCommandSync"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-elements",
3
3
  "description": "This package contains the elements model for the Elementor editor",
4
- "version": "4.0.0-573",
4
+ "version": "4.0.0-597",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,12 +40,12 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-mcp": "4.0.0-573",
44
- "@elementor/editor-props": "4.0.0-573",
45
- "@elementor/editor-styles": "4.0.0-573",
46
- "@elementor/editor-v1-adapters": "4.0.0-573",
47
- "@elementor/schema": "4.0.0-573",
48
- "@elementor/utils": "4.0.0-573",
43
+ "@elementor/editor-mcp": "4.0.0-597",
44
+ "@elementor/editor-props": "4.0.0-597",
45
+ "@elementor/editor-styles": "4.0.0-597",
46
+ "@elementor/editor-v1-adapters": "4.0.0-597",
47
+ "@elementor/schema": "4.0.0-597",
48
+ "@elementor/utils": "4.0.0-597",
49
49
  "@wordpress/i18n": "^3.1.0"
50
50
  },
51
51
  "peerDependencies": {
@@ -24,5 +24,6 @@ export function getElementType( type: string ): ElementType | null {
24
24
  dependenciesPerTargetMapping: elementType.dependencies_per_target_mapping ?? {},
25
25
  title: elementType.title,
26
26
  styleStates: elementType.atomic_style_states ?? [],
27
+ pseudoStates: elementType.atomic_pseudo_states ?? [],
27
28
  };
28
29
  }
package/src/sync/types.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { type PropsSchema, type PropValue, type SizePropValue } from '@elementor/editor-props';
2
2
  import { type ClassState, type StyleDefinition, type StyleDefinitionID } from '@elementor/editor-styles';
3
3
 
4
- import { type ControlItem } from '../types';
4
+ import { type ControlItem, type PseudoState } from '../types';
5
5
 
6
6
  export type ExtendedWindow = Window & {
7
7
  elementor?: {
@@ -83,6 +83,7 @@ export type AnimationPresetPropValue = {
83
83
  $$type: 'animation-preset-props';
84
84
  value: {
85
85
  effect: StringPropValue;
86
+ custom_effect?: PropValue;
86
87
  type: StringPropValue;
87
88
  direction: StringPropValue;
88
89
  timing_config: TimingConfigPropValue;
@@ -158,6 +159,7 @@ export type V1ElementConfig< T = object > = {
158
159
  base_styles?: Record< string, StyleDefinition >;
159
160
  base_styles_dictionary?: Record< string, string >;
160
161
  atomic_style_states?: ClassState[];
162
+ atomic_pseudo_states?: PseudoState[];
161
163
  show_in_panel?: boolean;
162
164
  meta?: { [ key: string ]: string | number | boolean | null | NonNullable< V1ElementConfig[ 'meta' ] > };
163
165
  } & T;
package/src/types.ts CHANGED
@@ -8,12 +8,18 @@ export type Element = {
8
8
  type: string;
9
9
  };
10
10
 
11
+ export type PseudoState = {
12
+ name: string;
13
+ value: string;
14
+ };
15
+
11
16
  export type ElementType = {
12
17
  key: string;
13
18
  controls: ControlItem[];
14
19
  propsSchema: PropsSchema;
15
20
  dependenciesPerTargetMapping?: Record< string, string[] >;
16
21
  styleStates?: ClassState[];
22
+ pseudoStates?: PseudoState[];
17
23
  title: string;
18
24
  };
19
25