@elementor/editor-components 3.35.0-360 → 3.35.0-362
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.js +73 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/components/component-panel-header/component-panel-header.tsx +2 -3
- package/src/components/edit-component/component-modal.tsx +1 -0
- package/src/components/edit-component/edit-component.tsx +9 -6
- package/src/components/overridable-props/overridable-prop-control.tsx +3 -4
- package/src/components/overridable-props/overridable-prop-indicator.tsx +2 -2
- package/src/store/store.ts +6 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-components",
|
|
3
3
|
"description": "Elementor editor components",
|
|
4
|
-
"version": "3.35.0-
|
|
4
|
+
"version": "3.35.0-362",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,29 +40,29 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor": "3.35.0-
|
|
44
|
-
"@elementor/editor-canvas": "3.35.0-
|
|
45
|
-
"@elementor/editor-controls": "3.35.0-
|
|
46
|
-
"@elementor/editor-documents": "3.35.0-
|
|
47
|
-
"@elementor/editor-editing-panel": "3.35.0-
|
|
48
|
-
"@elementor/editor-elements": "3.35.0-
|
|
49
|
-
"@elementor/editor-elements-panel": "3.35.0-
|
|
50
|
-
"@elementor/editor-mcp": "3.35.0-
|
|
51
|
-
"@elementor/editor-panels": "3.35.0-
|
|
52
|
-
"@elementor/editor-props": "3.35.0-
|
|
53
|
-
"@elementor/editor-styles-repository": "3.35.0-
|
|
54
|
-
"@elementor/editor-ui": "3.35.0-
|
|
55
|
-
"@elementor/editor-v1-adapters": "3.35.0-
|
|
56
|
-
"@elementor/http-client": "3.35.0-
|
|
43
|
+
"@elementor/editor": "3.35.0-362",
|
|
44
|
+
"@elementor/editor-canvas": "3.35.0-362",
|
|
45
|
+
"@elementor/editor-controls": "3.35.0-362",
|
|
46
|
+
"@elementor/editor-documents": "3.35.0-362",
|
|
47
|
+
"@elementor/editor-editing-panel": "3.35.0-362",
|
|
48
|
+
"@elementor/editor-elements": "3.35.0-362",
|
|
49
|
+
"@elementor/editor-elements-panel": "3.35.0-362",
|
|
50
|
+
"@elementor/editor-mcp": "3.35.0-362",
|
|
51
|
+
"@elementor/editor-panels": "3.35.0-362",
|
|
52
|
+
"@elementor/editor-props": "3.35.0-362",
|
|
53
|
+
"@elementor/editor-styles-repository": "3.35.0-362",
|
|
54
|
+
"@elementor/editor-ui": "3.35.0-362",
|
|
55
|
+
"@elementor/editor-v1-adapters": "3.35.0-362",
|
|
56
|
+
"@elementor/http-client": "3.35.0-362",
|
|
57
57
|
"@elementor/icons": "^1.62.0",
|
|
58
|
-
"@elementor/mixpanel": "3.35.0-
|
|
59
|
-
"@elementor/query": "3.35.0-
|
|
60
|
-
"@elementor/schema": "3.35.0-
|
|
61
|
-
"@elementor/store": "3.35.0-
|
|
58
|
+
"@elementor/mixpanel": "3.35.0-362",
|
|
59
|
+
"@elementor/query": "3.35.0-362",
|
|
60
|
+
"@elementor/schema": "3.35.0-362",
|
|
61
|
+
"@elementor/store": "3.35.0-362",
|
|
62
62
|
"@elementor/ui": "1.36.17",
|
|
63
|
-
"@elementor/utils": "3.35.0-
|
|
63
|
+
"@elementor/utils": "3.35.0-362",
|
|
64
64
|
"@wordpress/i18n": "^5.13.0",
|
|
65
|
-
"@elementor/editor-notifications": "3.35.0-
|
|
65
|
+
"@elementor/editor-notifications": "3.35.0-362"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.3.1",
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getV1DocumentsManager } from '@elementor/editor-documents';
|
|
3
3
|
import { ArrowLeftIcon, ComponentsFilledIcon } from '@elementor/icons';
|
|
4
|
-
import { __useSelector as useSelector } from '@elementor/store';
|
|
5
4
|
import { Box, Divider, IconButton, Stack, Tooltip, Typography } from '@elementor/ui';
|
|
6
5
|
import { __ } from '@wordpress/i18n';
|
|
7
6
|
|
|
8
7
|
import { useNavigateBack } from '../../hooks/use-navigate-back';
|
|
9
|
-
import {
|
|
8
|
+
import { useCurrentComponentId } from '../../store/store';
|
|
10
9
|
import { ComponentsBadge } from './component-badge';
|
|
11
10
|
import { useOverridableProps } from './use-overridable-props';
|
|
12
11
|
|
|
13
12
|
export const ComponentPanelHeader = () => {
|
|
14
|
-
const currentComponentId =
|
|
13
|
+
const currentComponentId = useCurrentComponentId();
|
|
15
14
|
const overridableProps = useOverridableProps( currentComponentId );
|
|
16
15
|
const onBack = useNavigateBack();
|
|
17
16
|
const componentName = getComponentName();
|
|
@@ -4,20 +4,23 @@ import { getV1DocumentsManager, type V1Document } from '@elementor/editor-docume
|
|
|
4
4
|
import { type V1Element } from '@elementor/editor-elements';
|
|
5
5
|
import { __privateListenTo as listenTo, commandEndEvent } from '@elementor/editor-v1-adapters';
|
|
6
6
|
import { __useSelector as useSelector } from '@elementor/store';
|
|
7
|
+
import { throttle } from '@elementor/utils';
|
|
7
8
|
|
|
8
9
|
import { apiClient } from '../../api';
|
|
9
10
|
import { useNavigateBack } from '../../hooks/use-navigate-back';
|
|
10
11
|
import { updateCurrentComponent } from '../../store/actions/update-current-component';
|
|
11
|
-
import { type ComponentsPathItem,
|
|
12
|
+
import { type ComponentsPathItem, selectPath, useCurrentComponentId } from '../../store/store';
|
|
12
13
|
import { COMPONENT_DOCUMENT_TYPE } from '../consts';
|
|
13
14
|
import { ComponentModal } from './component-modal';
|
|
14
15
|
|
|
15
16
|
export function EditComponent() {
|
|
16
|
-
const currentComponentId =
|
|
17
|
+
const currentComponentId = useCurrentComponentId();
|
|
17
18
|
|
|
18
19
|
useHandleDocumentSwitches();
|
|
19
20
|
|
|
20
|
-
const
|
|
21
|
+
const navigateBack = useNavigateBack();
|
|
22
|
+
|
|
23
|
+
const onClose = throttle( navigateBack, 100 );
|
|
21
24
|
|
|
22
25
|
const elementDom = getComponentDOMElement( currentComponentId ?? undefined );
|
|
23
26
|
|
|
@@ -25,16 +28,16 @@ export function EditComponent() {
|
|
|
25
28
|
return null;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
return <ComponentModal element={ elementDom } onClose={
|
|
31
|
+
return <ComponentModal element={ elementDom } onClose={ onClose } />;
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
function useHandleDocumentSwitches() {
|
|
32
35
|
const documentsManager = getV1DocumentsManager();
|
|
33
|
-
const currentComponentId =
|
|
36
|
+
const currentComponentId = useCurrentComponentId();
|
|
34
37
|
const path = useSelector( selectPath );
|
|
35
38
|
|
|
36
39
|
useEffect( () => {
|
|
37
|
-
return listenTo( commandEndEvent( 'editor/documents/
|
|
40
|
+
return listenTo( commandEndEvent( 'editor/documents/open' ), () => {
|
|
38
41
|
const nextDocument = documentsManager.getCurrent();
|
|
39
42
|
|
|
40
43
|
if ( nextDocument.id === currentComponentId ) {
|
|
@@ -3,7 +3,6 @@ import { type ComponentType } from 'react';
|
|
|
3
3
|
import { ControlReplacementsProvider, PropKeyProvider, PropProvider, useBoundProp } from '@elementor/editor-controls';
|
|
4
4
|
import { createTopLevelObjectType, useElement } from '@elementor/editor-editing-panel';
|
|
5
5
|
import { type PropValue } from '@elementor/editor-props';
|
|
6
|
-
import { __getState as getState } from '@elementor/store';
|
|
7
6
|
|
|
8
7
|
import {
|
|
9
8
|
componentOverridablePropTypeUtil,
|
|
@@ -11,7 +10,7 @@ import {
|
|
|
11
10
|
} from '../../prop-types/component-overridable-prop-type';
|
|
12
11
|
import { OverridablePropProvider } from '../../provider/overridable-prop-context';
|
|
13
12
|
import { updateOverridablePropOriginValue } from '../../store/actions/update-overridable-prop-origin-value';
|
|
14
|
-
import {
|
|
13
|
+
import { useCurrentComponentId } from '../../store/store';
|
|
15
14
|
|
|
16
15
|
export function OverridablePropControl< T extends object >( {
|
|
17
16
|
OriginalControl,
|
|
@@ -20,10 +19,10 @@ export function OverridablePropControl< T extends object >( {
|
|
|
20
19
|
const { elementType } = useElement();
|
|
21
20
|
|
|
22
21
|
const { value, bind, setValue, placeholder, ...propContext } = useBoundProp( componentOverridablePropTypeUtil );
|
|
23
|
-
const componentId =
|
|
22
|
+
const componentId = useCurrentComponentId();
|
|
24
23
|
|
|
25
24
|
if ( ! componentId ) {
|
|
26
|
-
|
|
25
|
+
return null;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
if ( ! value?.override_key ) {
|
|
@@ -10,7 +10,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
10
10
|
import { componentOverridablePropTypeUtil } from '../../prop-types/component-overridable-prop-type';
|
|
11
11
|
import { useOverridablePropValue } from '../../provider/overridable-prop-context';
|
|
12
12
|
import { setOverridableProp } from '../../store/actions/set-overridable-prop';
|
|
13
|
-
import {
|
|
13
|
+
import { selectOverridableProps, useCurrentComponentId } from '../../store/store';
|
|
14
14
|
import { type OverridableProps } from '../../types';
|
|
15
15
|
import { Indicator } from './indicator';
|
|
16
16
|
import { OverridablePropForm } from './overridable-prop-form';
|
|
@@ -20,7 +20,7 @@ const FORBIDDEN_KEYS = [ '_cssid', 'attributes' ];
|
|
|
20
20
|
|
|
21
21
|
export function OverridablePropIndicator() {
|
|
22
22
|
const { bind } = useBoundProp();
|
|
23
|
-
const componentId =
|
|
23
|
+
const componentId = useCurrentComponentId();
|
|
24
24
|
|
|
25
25
|
if ( ! isPropAllowed( bind ) || ! componentId ) {
|
|
26
26
|
return null;
|
package/src/store/store.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type V1Document } from '@elementor/editor-documents';
|
|
|
2
2
|
import {
|
|
3
3
|
__createSelector as createSelector,
|
|
4
4
|
__createSlice as createSlice,
|
|
5
|
+
__useSelector as useSelector,
|
|
5
6
|
type PayloadAction,
|
|
6
7
|
type SliceState,
|
|
7
8
|
} from '@elementor/store';
|
|
@@ -186,11 +187,16 @@ export const selectIsOverridablePropsLoaded = createSelector(
|
|
|
186
187
|
}
|
|
187
188
|
);
|
|
188
189
|
export const selectPath = createSelector( getPath, ( path ) => path );
|
|
190
|
+
|
|
189
191
|
export const selectCurrentComponentId = createSelector(
|
|
190
192
|
getCurrentComponentId,
|
|
191
193
|
( currentComponentId ) => currentComponentId
|
|
192
194
|
);
|
|
193
195
|
|
|
196
|
+
export const useCurrentComponentId = () => {
|
|
197
|
+
return useSelector( selectCurrentComponentId );
|
|
198
|
+
};
|
|
199
|
+
|
|
194
200
|
export const selectArchivedComponents = createSelector(
|
|
195
201
|
selectArchivedData,
|
|
196
202
|
( archivedData: PublishedComponent[] ) => archivedData
|