@elementor/editor-controls 3.35.0-436 → 3.35.0-438
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +81 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/transform-control/transform-repeater-control.tsx +7 -1
- package/src/controls/transform-control/transform-settings-control.tsx +10 -4
- package/src/hooks/use-element-can-have-children.ts +17 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-controls",
|
|
3
3
|
"description": "This package contains the controls model and utils for the Elementor editor",
|
|
4
|
-
"version": "3.35.0-
|
|
4
|
+
"version": "3.35.0-438",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor-current-user": "3.35.0-
|
|
44
|
-
"@elementor/editor-elements": "3.35.0-
|
|
45
|
-
"@elementor/editor-props": "3.35.0-
|
|
46
|
-
"@elementor/editor-responsive": "3.35.0-
|
|
47
|
-
"@elementor/editor-ui": "3.35.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "3.35.0-
|
|
49
|
-
"@elementor/env": "3.35.0-
|
|
50
|
-
"@elementor/http-client": "3.35.0-
|
|
43
|
+
"@elementor/editor-current-user": "3.35.0-438",
|
|
44
|
+
"@elementor/editor-elements": "3.35.0-438",
|
|
45
|
+
"@elementor/editor-props": "3.35.0-438",
|
|
46
|
+
"@elementor/editor-responsive": "3.35.0-438",
|
|
47
|
+
"@elementor/editor-ui": "3.35.0-438",
|
|
48
|
+
"@elementor/editor-v1-adapters": "3.35.0-438",
|
|
49
|
+
"@elementor/env": "3.35.0-438",
|
|
50
|
+
"@elementor/http-client": "3.35.0-438",
|
|
51
51
|
"@elementor/icons": "^1.63.0",
|
|
52
|
-
"@elementor/locations": "3.35.0-
|
|
53
|
-
"@elementor/mixpanel": "3.35.0-
|
|
54
|
-
"@elementor/query": "3.35.0-
|
|
55
|
-
"@elementor/session": "3.35.0-
|
|
52
|
+
"@elementor/locations": "3.35.0-438",
|
|
53
|
+
"@elementor/mixpanel": "3.35.0-438",
|
|
54
|
+
"@elementor/query": "3.35.0-438",
|
|
55
|
+
"@elementor/session": "3.35.0-438",
|
|
56
56
|
"@elementor/ui": "1.36.17",
|
|
57
|
-
"@elementor/utils": "3.35.0-
|
|
58
|
-
"@elementor/wp-media": "3.35.0-
|
|
57
|
+
"@elementor/utils": "3.35.0-438",
|
|
58
|
+
"@elementor/wp-media": "3.35.0-438",
|
|
59
59
|
"@wordpress/i18n": "^5.13.0",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"dayjs": "^1.11.18",
|
|
@@ -13,6 +13,7 @@ import { EditItemPopover } from '../../components/control-repeater/items/edit-it
|
|
|
13
13
|
import { RepeaterHeader } from '../../components/repeater/repeater-header';
|
|
14
14
|
import { ControlAdornments } from '../../control-adornments/control-adornments';
|
|
15
15
|
import { createControl } from '../../create-control';
|
|
16
|
+
import { useElementCanHaveChildren } from '../../hooks/use-element-can-have-children';
|
|
16
17
|
import { initialRotateValue, initialScaleValue, initialSkewValue, initialTransformValue } from './initial-values';
|
|
17
18
|
import { TransformContent } from './transform-content';
|
|
18
19
|
import { TransformIcon } from './transform-icon';
|
|
@@ -25,10 +26,15 @@ export const TransformRepeaterControl = createControl( () => {
|
|
|
25
26
|
const context = useBoundProp( transformPropTypeUtil );
|
|
26
27
|
const headerRef = useRef< HTMLDivElement >( null );
|
|
27
28
|
const popupState = usePopupState( { variant: 'popover' } );
|
|
29
|
+
const showChildrenPerspective = useElementCanHaveChildren();
|
|
28
30
|
|
|
29
31
|
return (
|
|
30
32
|
<PropProvider { ...context }>
|
|
31
|
-
<TransformSettingsControl
|
|
33
|
+
<TransformSettingsControl
|
|
34
|
+
popupState={ popupState }
|
|
35
|
+
anchorRef={ headerRef }
|
|
36
|
+
showChildrenPerspective={ showChildrenPerspective }
|
|
37
|
+
/>
|
|
32
38
|
<PropKeyProvider bind={ 'transform-functions' }>
|
|
33
39
|
<Repeater headerRef={ headerRef } propType={ context.propType } popupState={ popupState } />
|
|
34
40
|
</PropKeyProvider>
|
|
@@ -14,9 +14,11 @@ const SIZE = 'tiny';
|
|
|
14
14
|
export const TransformSettingsControl = ( {
|
|
15
15
|
popupState,
|
|
16
16
|
anchorRef,
|
|
17
|
+
showChildrenPerspective,
|
|
17
18
|
}: {
|
|
18
19
|
popupState: PopupState;
|
|
19
20
|
anchorRef: React.RefObject< HTMLDivElement | null >;
|
|
21
|
+
showChildrenPerspective: boolean;
|
|
20
22
|
} ) => {
|
|
21
23
|
const popupProps = bindPopover( {
|
|
22
24
|
...popupState,
|
|
@@ -47,10 +49,14 @@ export const TransformSettingsControl = ( {
|
|
|
47
49
|
<PropKeyProvider bind={ 'transform-origin' }>
|
|
48
50
|
<TransformOriginControl />
|
|
49
51
|
</PropKeyProvider>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
{ showChildrenPerspective && (
|
|
53
|
+
<>
|
|
54
|
+
<Box sx={ { my: 0.5 } }>
|
|
55
|
+
<Divider />
|
|
56
|
+
</Box>
|
|
57
|
+
<ChildrenPerspectiveControl />
|
|
58
|
+
</>
|
|
59
|
+
) }
|
|
54
60
|
</PopoverContent>
|
|
55
61
|
</Popover>
|
|
56
62
|
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { getContainer, useSelectedElement } from '@elementor/editor-elements';
|
|
3
|
+
|
|
4
|
+
export const useElementCanHaveChildren = (): boolean => {
|
|
5
|
+
const { element } = useSelectedElement();
|
|
6
|
+
const elementId = element?.id || '';
|
|
7
|
+
|
|
8
|
+
return useMemo( () => {
|
|
9
|
+
const container = getContainer( elementId );
|
|
10
|
+
|
|
11
|
+
if ( ! container ) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return container.model.get( 'elType' ) !== 'widget';
|
|
16
|
+
}, [ elementId ] );
|
|
17
|
+
};
|
package/src/index.ts
CHANGED