@elementor/editor-components 4.0.0-663 → 4.0.0-665
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 +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +1246 -845
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1013 -613
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -23
- package/src/components/detach-instance-confirmation-dialog.tsx +50 -0
- package/src/components/instance-editing-panel/detach-action.tsx +76 -0
- package/src/components/instance-editing-panel/instance-editing-panel.tsx +12 -5
- package/src/components/instance-editing-panel/use-instance-panel-data.ts +2 -2
- package/src/consts.ts +1 -0
- package/src/create-component-type.ts +60 -22
- package/src/index.ts +1 -0
- package/src/init.ts +6 -1
- package/src/types.ts +1 -1
- package/src/utils/detach-component-instance/detach-component-instance.ts +172 -0
- package/src/utils/detach-component-instance/index.ts +1 -0
- package/src/utils/detach-component-instance/regenerate-local-style-ids.ts +53 -0
- package/src/utils/detach-component-instance/resolve-detached-instance.ts +94 -0
- package/src/utils/detach-component-instance/resolve-overridable-settings.ts +121 -0
- package/src/utils/is-component-instance.ts +1 -1
- package/src/utils/tracking.ts +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -74,7 +74,7 @@ type ExtendedWindow = Window & {
|
|
|
74
74
|
elementorCommon: Record<string, unknown> & {
|
|
75
75
|
eventsManager: {
|
|
76
76
|
config: {
|
|
77
|
-
locations: Record<string, string
|
|
77
|
+
locations: Record<string, string | Record<string, string>>;
|
|
78
78
|
secondaryLocations: Record<string, string>;
|
|
79
79
|
triggers: Record<string, string>;
|
|
80
80
|
};
|
|
@@ -530,10 +530,15 @@ type InstancePanelData = {
|
|
|
530
530
|
overridableProps: NonNullable<ReturnType<typeof useSanitizeOverridableProps>>;
|
|
531
531
|
groups: OverridablePropsGroup[];
|
|
532
532
|
isEmpty: boolean;
|
|
533
|
-
componentInstanceId: string
|
|
533
|
+
componentInstanceId: string;
|
|
534
534
|
};
|
|
535
535
|
declare function useInstancePanelData(): InstancePanelData | null;
|
|
536
536
|
|
|
537
|
+
declare const DetachAction: ({ componentInstanceId, componentId, }: {
|
|
538
|
+
componentInstanceId: string;
|
|
539
|
+
componentId: number;
|
|
540
|
+
}) => React.JSX.Element;
|
|
541
|
+
|
|
537
542
|
declare const COMPONENT_WIDGET_TYPE = "e-component";
|
|
538
543
|
|
|
539
544
|
declare const useComponents: () => {
|
|
@@ -1399,10 +1404,10 @@ declare function switchToComponent(componentId: number, componentInstanceId?: st
|
|
|
1399
1404
|
|
|
1400
1405
|
type Source = 'user' | 'mcp_tool' | 'system';
|
|
1401
1406
|
type ComponentEventData = Record<string, unknown> & {
|
|
1402
|
-
action: 'createClicked' | 'created' | 'createCancelled' | 'instanceAdded' | 'edited' | 'propertyExposed' | 'propertyRemoved' | 'propertiesPanelOpened' | 'propertiesGroupCreated';
|
|
1407
|
+
action: 'createClicked' | 'created' | 'createCancelled' | 'instanceAdded' | 'edited' | 'propertyExposed' | 'propertyRemoved' | 'propertiesPanelOpened' | 'propertiesGroupCreated' | 'detached';
|
|
1403
1408
|
source: Source;
|
|
1404
1409
|
};
|
|
1405
1410
|
declare const trackComponentEvent: ({ action, source, ...data }: ComponentEventData) => void;
|
|
1406
1411
|
declare const onElementDrop: (_args: unknown, element: V1Element) => void;
|
|
1407
1412
|
|
|
1408
|
-
export { COMPONENT_WIDGET_TYPE, type Component, type ComponentFormValues, type ComponentId, type ComponentInstanceOverride, type ComponentInstanceOverrideProp, type ComponentInstanceOverridePropValue, type ComponentInstanceOverridesPropValue, type ComponentInstanceProp, type ComponentInstancePropValue, ComponentInstanceProvider, ComponentItem, type ComponentItemProps, ComponentName, type ComponentOverridableProp, type ComponentOverridablePropValue, ComponentSearch, EmptyState$1 as ComponentsEmptyState, ComponentsList, type ComponentsPathItem, type ComponentsSlice, type DocumentSaveStatus, EditComponentAction, EmptySearchResult, type ExtendedWindow, EmptyState as InstanceEmptyState, InstancePanelBody, InstancePanelHeader, LoadingComponents, type OriginPropFields, type OriginalElementData, type OverridableProp, OverridablePropProvider, type OverridableProps, type OverridablePropsGroup, type PublishedComponent, SLICE_NAME, type SanitizeAttributes, SearchProvider, type Source, type StylesDefinition, type UnpublishedComponent, type UpdatedComponentName, apiClient, componentInstanceOverridePropTypeUtil, componentInstanceOverridesPropTypeUtil, componentInstancePropTypeUtil, componentOverridablePropTypeUtil, componentsActions, componentsSelectors, filterValidOverridableProps, getContainerByOriginId, getOverridableProp, getPropTypeForComponentOverride, init, isComponentInstance, loadComponentsAssets, onElementDrop, publishDraftComponentsInPageBeforeSave, resolveOverridePropValue, selectOverridableProps, selectPath, slice, switchToComponent, trackComponentEvent, updateOverridableProp, useComponentInstanceElement, useComponents, useComponentsPermissions, useCurrentComponent, useCurrentComponentId, useFilteredComponents, useInstancePanelData, useIsSanitizedComponent, useOverridablePropValue, useOverridableProps, useSanitizeOverridableProps };
|
|
1413
|
+
export { COMPONENT_WIDGET_TYPE, type Component, type ComponentFormValues, type ComponentId, type ComponentInstanceOverride, type ComponentInstanceOverrideProp, type ComponentInstanceOverridePropValue, type ComponentInstanceOverridesPropValue, type ComponentInstanceProp, type ComponentInstancePropValue, ComponentInstanceProvider, ComponentItem, type ComponentItemProps, ComponentName, type ComponentOverridableProp, type ComponentOverridablePropValue, ComponentSearch, EmptyState$1 as ComponentsEmptyState, ComponentsList, type ComponentsPathItem, type ComponentsSlice, DetachAction, type DocumentSaveStatus, EditComponentAction, EmptySearchResult, type ExtendedWindow, EmptyState as InstanceEmptyState, InstancePanelBody, InstancePanelHeader, LoadingComponents, type OriginPropFields, type OriginalElementData, type OverridableProp, OverridablePropProvider, type OverridableProps, type OverridablePropsGroup, type PublishedComponent, SLICE_NAME, type SanitizeAttributes, SearchProvider, type Source, type StylesDefinition, type UnpublishedComponent, type UpdatedComponentName, apiClient, componentInstanceOverridePropTypeUtil, componentInstanceOverridesPropTypeUtil, componentInstancePropTypeUtil, componentOverridablePropTypeUtil, componentsActions, componentsSelectors, filterValidOverridableProps, getContainerByOriginId, getOverridableProp, getPropTypeForComponentOverride, init, isComponentInstance, loadComponentsAssets, onElementDrop, publishDraftComponentsInPageBeforeSave, resolveOverridePropValue, selectOverridableProps, selectPath, slice, switchToComponent, trackComponentEvent, updateOverridableProp, useComponentInstanceElement, useComponents, useComponentsPermissions, useCurrentComponent, useCurrentComponentId, useFilteredComponents, useInstancePanelData, useIsSanitizedComponent, useOverridablePropValue, useOverridableProps, useSanitizeOverridableProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ type ExtendedWindow = Window & {
|
|
|
74
74
|
elementorCommon: Record<string, unknown> & {
|
|
75
75
|
eventsManager: {
|
|
76
76
|
config: {
|
|
77
|
-
locations: Record<string, string
|
|
77
|
+
locations: Record<string, string | Record<string, string>>;
|
|
78
78
|
secondaryLocations: Record<string, string>;
|
|
79
79
|
triggers: Record<string, string>;
|
|
80
80
|
};
|
|
@@ -530,10 +530,15 @@ type InstancePanelData = {
|
|
|
530
530
|
overridableProps: NonNullable<ReturnType<typeof useSanitizeOverridableProps>>;
|
|
531
531
|
groups: OverridablePropsGroup[];
|
|
532
532
|
isEmpty: boolean;
|
|
533
|
-
componentInstanceId: string
|
|
533
|
+
componentInstanceId: string;
|
|
534
534
|
};
|
|
535
535
|
declare function useInstancePanelData(): InstancePanelData | null;
|
|
536
536
|
|
|
537
|
+
declare const DetachAction: ({ componentInstanceId, componentId, }: {
|
|
538
|
+
componentInstanceId: string;
|
|
539
|
+
componentId: number;
|
|
540
|
+
}) => React.JSX.Element;
|
|
541
|
+
|
|
537
542
|
declare const COMPONENT_WIDGET_TYPE = "e-component";
|
|
538
543
|
|
|
539
544
|
declare const useComponents: () => {
|
|
@@ -1399,10 +1404,10 @@ declare function switchToComponent(componentId: number, componentInstanceId?: st
|
|
|
1399
1404
|
|
|
1400
1405
|
type Source = 'user' | 'mcp_tool' | 'system';
|
|
1401
1406
|
type ComponentEventData = Record<string, unknown> & {
|
|
1402
|
-
action: 'createClicked' | 'created' | 'createCancelled' | 'instanceAdded' | 'edited' | 'propertyExposed' | 'propertyRemoved' | 'propertiesPanelOpened' | 'propertiesGroupCreated';
|
|
1407
|
+
action: 'createClicked' | 'created' | 'createCancelled' | 'instanceAdded' | 'edited' | 'propertyExposed' | 'propertyRemoved' | 'propertiesPanelOpened' | 'propertiesGroupCreated' | 'detached';
|
|
1403
1408
|
source: Source;
|
|
1404
1409
|
};
|
|
1405
1410
|
declare const trackComponentEvent: ({ action, source, ...data }: ComponentEventData) => void;
|
|
1406
1411
|
declare const onElementDrop: (_args: unknown, element: V1Element) => void;
|
|
1407
1412
|
|
|
1408
|
-
export { COMPONENT_WIDGET_TYPE, type Component, type ComponentFormValues, type ComponentId, type ComponentInstanceOverride, type ComponentInstanceOverrideProp, type ComponentInstanceOverridePropValue, type ComponentInstanceOverridesPropValue, type ComponentInstanceProp, type ComponentInstancePropValue, ComponentInstanceProvider, ComponentItem, type ComponentItemProps, ComponentName, type ComponentOverridableProp, type ComponentOverridablePropValue, ComponentSearch, EmptyState$1 as ComponentsEmptyState, ComponentsList, type ComponentsPathItem, type ComponentsSlice, type DocumentSaveStatus, EditComponentAction, EmptySearchResult, type ExtendedWindow, EmptyState as InstanceEmptyState, InstancePanelBody, InstancePanelHeader, LoadingComponents, type OriginPropFields, type OriginalElementData, type OverridableProp, OverridablePropProvider, type OverridableProps, type OverridablePropsGroup, type PublishedComponent, SLICE_NAME, type SanitizeAttributes, SearchProvider, type Source, type StylesDefinition, type UnpublishedComponent, type UpdatedComponentName, apiClient, componentInstanceOverridePropTypeUtil, componentInstanceOverridesPropTypeUtil, componentInstancePropTypeUtil, componentOverridablePropTypeUtil, componentsActions, componentsSelectors, filterValidOverridableProps, getContainerByOriginId, getOverridableProp, getPropTypeForComponentOverride, init, isComponentInstance, loadComponentsAssets, onElementDrop, publishDraftComponentsInPageBeforeSave, resolveOverridePropValue, selectOverridableProps, selectPath, slice, switchToComponent, trackComponentEvent, updateOverridableProp, useComponentInstanceElement, useComponents, useComponentsPermissions, useCurrentComponent, useCurrentComponentId, useFilteredComponents, useInstancePanelData, useIsSanitizedComponent, useOverridablePropValue, useOverridableProps, useSanitizeOverridableProps };
|
|
1413
|
+
export { COMPONENT_WIDGET_TYPE, type Component, type ComponentFormValues, type ComponentId, type ComponentInstanceOverride, type ComponentInstanceOverrideProp, type ComponentInstanceOverridePropValue, type ComponentInstanceOverridesPropValue, type ComponentInstanceProp, type ComponentInstancePropValue, ComponentInstanceProvider, ComponentItem, type ComponentItemProps, ComponentName, type ComponentOverridableProp, type ComponentOverridablePropValue, ComponentSearch, EmptyState$1 as ComponentsEmptyState, ComponentsList, type ComponentsPathItem, type ComponentsSlice, DetachAction, type DocumentSaveStatus, EditComponentAction, EmptySearchResult, type ExtendedWindow, EmptyState as InstanceEmptyState, InstancePanelBody, InstancePanelHeader, LoadingComponents, type OriginPropFields, type OriginalElementData, type OverridableProp, OverridablePropProvider, type OverridableProps, type OverridablePropsGroup, type PublishedComponent, SLICE_NAME, type SanitizeAttributes, SearchProvider, type Source, type StylesDefinition, type UnpublishedComponent, type UpdatedComponentName, apiClient, componentInstanceOverridePropTypeUtil, componentInstanceOverridesPropTypeUtil, componentInstancePropTypeUtil, componentOverridablePropTypeUtil, componentsActions, componentsSelectors, filterValidOverridableProps, getContainerByOriginId, getOverridableProp, getPropTypeForComponentOverride, init, isComponentInstance, loadComponentsAssets, onElementDrop, publishDraftComponentsInPageBeforeSave, resolveOverridePropValue, selectOverridableProps, selectPath, slice, switchToComponent, trackComponentEvent, updateOverridableProp, useComponentInstanceElement, useComponents, useComponentsPermissions, useCurrentComponent, useCurrentComponentId, useFilteredComponents, useInstancePanelData, useIsSanitizedComponent, useOverridablePropValue, useOverridableProps, useSanitizeOverridableProps };
|