@elementor/editor-controls 4.1.0-734 → 4.1.0-736
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 +162 -158
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/control-repeater/context/repeater-context.tsx +4 -4
- package/src/components/control-repeater/items/item.tsx +2 -1
- package/src/components/inline-editor-toolbar.tsx +2 -2
- package/src/controls/font-family-control/font-family-control.tsx +2 -1
- package/src/controls/size-control.tsx +2 -2
- package/src/controls/transform-control/transform-base-controls/children-perspective-control.tsx +2 -1
- package/src/controls/transform-control/transform-base-controls/transform-origin-control.tsx +2 -1
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": "4.1.0-
|
|
4
|
+
"version": "4.1.0-736",
|
|
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": "4.1.0-
|
|
44
|
-
"@elementor/editor-elements": "4.1.0-
|
|
45
|
-
"@elementor/editor-props": "4.1.0-
|
|
46
|
-
"@elementor/editor-responsive": "4.1.0-
|
|
47
|
-
"@elementor/editor-ui": "4.1.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "4.1.0-
|
|
49
|
-
"@elementor/env": "4.1.0-
|
|
50
|
-
"@elementor/http-client": "4.1.0-
|
|
43
|
+
"@elementor/editor-current-user": "4.1.0-736",
|
|
44
|
+
"@elementor/editor-elements": "4.1.0-736",
|
|
45
|
+
"@elementor/editor-props": "4.1.0-736",
|
|
46
|
+
"@elementor/editor-responsive": "4.1.0-736",
|
|
47
|
+
"@elementor/editor-ui": "4.1.0-736",
|
|
48
|
+
"@elementor/editor-v1-adapters": "4.1.0-736",
|
|
49
|
+
"@elementor/env": "4.1.0-736",
|
|
50
|
+
"@elementor/http-client": "4.1.0-736",
|
|
51
51
|
"@elementor/icons": "^1.68.0",
|
|
52
|
-
"@elementor/locations": "4.1.0-
|
|
53
|
-
"@elementor/events": "4.1.0-
|
|
54
|
-
"@elementor/query": "4.1.0-
|
|
55
|
-
"@elementor/session": "4.1.0-
|
|
52
|
+
"@elementor/locations": "4.1.0-736",
|
|
53
|
+
"@elementor/events": "4.1.0-736",
|
|
54
|
+
"@elementor/query": "4.1.0-736",
|
|
55
|
+
"@elementor/session": "4.1.0-736",
|
|
56
56
|
"@elementor/ui": "1.36.17",
|
|
57
|
-
"@elementor/utils": "4.1.0-
|
|
58
|
-
"@elementor/wp-media": "4.1.0-
|
|
57
|
+
"@elementor/utils": "4.1.0-736",
|
|
58
|
+
"@elementor/wp-media": "4.1.0-736",
|
|
59
59
|
"@wordpress/i18n": "^5.13.0",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"dayjs": "^1.11.18",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { createContext, useMemo, useState } from 'react';
|
|
2
|
+
import { createContext, useContext, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { type PropTypeUtil } from '@elementor/editor-props';
|
|
4
4
|
import { type PopupState, usePopupState } from '@elementor/ui';
|
|
5
5
|
|
|
@@ -36,8 +36,8 @@ const RepeaterContext = createContext< RepeaterContextType< RepeatablePropValue
|
|
|
36
36
|
export const EMPTY_OPEN_ITEM = -1;
|
|
37
37
|
|
|
38
38
|
export const useRepeaterContext = () => {
|
|
39
|
-
const context =
|
|
40
|
-
const itemContext =
|
|
39
|
+
const context = useContext( RepeaterContext );
|
|
40
|
+
const itemContext = useContext( ItemContext );
|
|
41
41
|
|
|
42
42
|
if ( ! context ) {
|
|
43
43
|
throw new Error( 'useRepeaterContext must be used within a RepeaterContextProvider' );
|
|
@@ -70,7 +70,7 @@ export const RepeaterContextProvider = < T extends RepeatablePropValue = Repeata
|
|
|
70
70
|
return items?.map( () => generateUniqueKey() ) ?? [];
|
|
71
71
|
} );
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
useEffect( () => {
|
|
74
74
|
const nextLength = items?.length ?? 0;
|
|
75
75
|
|
|
76
76
|
setUniqueKeys( ( prev ) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useContext } from 'react';
|
|
2
3
|
import { bindTrigger } from '@elementor/ui';
|
|
3
4
|
import { __ } from '@wordpress/i18n';
|
|
4
5
|
|
|
@@ -18,7 +19,7 @@ export const Item = < T extends RepeatablePropValue >( { Label, Icon, actions }:
|
|
|
18
19
|
value,
|
|
19
20
|
isItemDisabled,
|
|
20
21
|
} = useRepeaterContext();
|
|
21
|
-
const repeatableContext =
|
|
22
|
+
const repeatableContext = useContext( RepeatableControlContext );
|
|
22
23
|
const disableOpen = !! repeatableContext?.props?.readOnly;
|
|
23
24
|
const triggerProps = bindTrigger( popoverState );
|
|
24
25
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { type ElementID, getContainer, getElementSetting } from '@elementor/editor-elements';
|
|
4
4
|
import { type LinkPropValue } from '@elementor/editor-props';
|
|
5
5
|
import {
|
|
@@ -100,7 +100,7 @@ export const InlineEditorToolbar = ( { editor, elementId, sx = {} }: InlineEdito
|
|
|
100
100
|
linkPopupState.close();
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
useEffect( () => {
|
|
104
104
|
editor?.commands?.focus();
|
|
105
105
|
}, [ editor ] );
|
|
106
106
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useMemo } from 'react';
|
|
2
3
|
import { stringPropTypeUtil } from '@elementor/editor-props';
|
|
3
4
|
import { ChevronDownIcon, TextIcon } from '@elementor/icons';
|
|
4
5
|
import { bindPopover, bindTrigger, Popover, UnstableTag, usePopupState } from '@elementor/ui';
|
|
@@ -34,7 +35,7 @@ export const FontFamilyControl = createControl(
|
|
|
34
35
|
const popoverState = usePopupState( { variant: 'popover' } );
|
|
35
36
|
const isShowingPlaceholder = ! fontFamily && placeholder;
|
|
36
37
|
|
|
37
|
-
const mapFontSubs =
|
|
38
|
+
const mapFontSubs = useMemo< Category[] >( () => {
|
|
38
39
|
return fontFamilies.map( ( { label, fonts } ) => ( {
|
|
39
40
|
label,
|
|
40
41
|
items: fonts,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type RefObject, useEffect, useMemo } from 'react';
|
|
2
|
+
import { type RefObject, useCallback, useEffect, useMemo } from 'react';
|
|
3
3
|
import { type PropType, sizePropTypeUtil, type SizePropValue } from '@elementor/editor-props';
|
|
4
4
|
import { useActiveBreakpoint } from '@elementor/editor-responsive';
|
|
5
5
|
import { usePopupState } from '@elementor/ui';
|
|
@@ -168,7 +168,7 @@ export const SizeControl = createControl(
|
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
const maybeClosePopup =
|
|
171
|
+
const maybeClosePopup = useCallback( () => {
|
|
172
172
|
if ( popupState && popupState.isOpen ) {
|
|
173
173
|
popupState.close();
|
|
174
174
|
}
|
package/src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useRef } from 'react';
|
|
2
3
|
import { perspectiveOriginPropTypeUtil } from '@elementor/editor-props';
|
|
3
4
|
import { Grid, Stack } from '@elementor/ui';
|
|
4
5
|
import { __ } from '@wordpress/i18n';
|
|
@@ -73,7 +74,7 @@ const PerspectiveOriginControlProvider = () => {
|
|
|
73
74
|
};
|
|
74
75
|
|
|
75
76
|
const ControlFields = ( { control }: { control: FieldProps } ) => {
|
|
76
|
-
const rowRef =
|
|
77
|
+
const rowRef = useRef< HTMLDivElement >( null );
|
|
77
78
|
|
|
78
79
|
return (
|
|
79
80
|
<PopoverGridContainer ref={ rowRef }>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useRef } from 'react';
|
|
2
3
|
import { transformOriginPropTypeUtil } from '@elementor/editor-props';
|
|
3
4
|
import { Grid, Stack } from '@elementor/ui';
|
|
4
5
|
import { __ } from '@wordpress/i18n';
|
|
@@ -43,7 +44,7 @@ export const TransformOriginControl = () => {
|
|
|
43
44
|
|
|
44
45
|
const ControlFields = ( { control }: { control: ( typeof TRANSFORM_ORIGIN_FIELDS )[ number ] } ) => {
|
|
45
46
|
const context = useBoundProp( transformOriginPropTypeUtil );
|
|
46
|
-
const rowRef =
|
|
47
|
+
const rowRef = useRef< HTMLDivElement >( null );
|
|
47
48
|
|
|
48
49
|
return (
|
|
49
50
|
<PropProvider { ...context }>
|