@elementor/editor-controls 3.32.0-55 → 3.32.0-57
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 +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -14
- package/src/controls/key-value-control.tsx +7 -1
- package/src/controls/text-control.tsx +3 -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.32.0-
|
|
4
|
+
"version": "3.32.0-57",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,21 +40,21 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor-current-user": "3.32.0-
|
|
44
|
-
"@elementor/editor-elements": "3.32.0-
|
|
45
|
-
"@elementor/editor-props": "3.32.0-
|
|
46
|
-
"@elementor/editor-responsive": "3.32.0-
|
|
47
|
-
"@elementor/editor-ui": "3.32.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "3.32.0-
|
|
49
|
-
"@elementor/env": "3.32.0-
|
|
50
|
-
"@elementor/http-client": "3.32.0-
|
|
43
|
+
"@elementor/editor-current-user": "3.32.0-57",
|
|
44
|
+
"@elementor/editor-elements": "3.32.0-57",
|
|
45
|
+
"@elementor/editor-props": "3.32.0-57",
|
|
46
|
+
"@elementor/editor-responsive": "3.32.0-57",
|
|
47
|
+
"@elementor/editor-ui": "3.32.0-57",
|
|
48
|
+
"@elementor/editor-v1-adapters": "3.32.0-57",
|
|
49
|
+
"@elementor/env": "3.32.0-57",
|
|
50
|
+
"@elementor/http-client": "3.32.0-57",
|
|
51
51
|
"@elementor/icons": "^1.51.1",
|
|
52
|
-
"@elementor/locations": "3.32.0-
|
|
53
|
-
"@elementor/query": "3.32.0-
|
|
54
|
-
"@elementor/session": "3.32.0-
|
|
52
|
+
"@elementor/locations": "3.32.0-57",
|
|
53
|
+
"@elementor/query": "3.32.0-57",
|
|
54
|
+
"@elementor/session": "3.32.0-57",
|
|
55
55
|
"@elementor/ui": "1.36.8",
|
|
56
|
-
"@elementor/utils": "3.32.0-
|
|
57
|
-
"@elementor/wp-media": "3.32.0-
|
|
56
|
+
"@elementor/utils": "3.32.0-57",
|
|
57
|
+
"@elementor/wp-media": "3.32.0-57",
|
|
58
58
|
"@wordpress/i18n": "^5.13.0",
|
|
59
59
|
"@monaco-editor/react": "^4.7.0"
|
|
60
60
|
},
|
|
@@ -21,6 +21,7 @@ type KeyValueControlProps = {
|
|
|
21
21
|
regexKey?: string;
|
|
22
22
|
regexValue?: string;
|
|
23
23
|
validationErrorMessage?: string;
|
|
24
|
+
getHelperText?: ( key: string, value: string ) => { keyHelper?: string; valueHelper?: string };
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
export const KeyValueControl = createControl( ( props: KeyValueControlProps = {} ) => {
|
|
@@ -110,7 +111,11 @@ export const KeyValueControl = createControl( ( props: KeyValueControlProps = {}
|
|
|
110
111
|
{ keyLabel }
|
|
111
112
|
</FormLabel>
|
|
112
113
|
<PropKeyProvider bind={ 'key' }>
|
|
113
|
-
<TextControl
|
|
114
|
+
<TextControl
|
|
115
|
+
inputValue={ sessionState.key }
|
|
116
|
+
error={ !! keyError }
|
|
117
|
+
helperText={ props.getHelperText?.( sessionState.key, sessionState.value )?.keyHelper }
|
|
118
|
+
/>
|
|
114
119
|
</PropKeyProvider>
|
|
115
120
|
{ !! keyError && <FormHelperText error>{ keyError }</FormHelperText> }
|
|
116
121
|
</Grid>
|
|
@@ -123,6 +128,7 @@ export const KeyValueControl = createControl( ( props: KeyValueControlProps = {}
|
|
|
123
128
|
inputValue={ sessionState.value }
|
|
124
129
|
error={ !! valueError }
|
|
125
130
|
inputDisabled={ !! keyError }
|
|
131
|
+
helperText={ props.getHelperText?.( sessionState.key, sessionState.value )?.valueHelper }
|
|
126
132
|
/>
|
|
127
133
|
</PropKeyProvider>
|
|
128
134
|
{ !! valueError && <FormHelperText error>{ valueError }</FormHelperText> }
|
|
@@ -12,12 +12,14 @@ export const TextControl = createControl(
|
|
|
12
12
|
error,
|
|
13
13
|
inputValue,
|
|
14
14
|
inputDisabled,
|
|
15
|
+
helperText,
|
|
15
16
|
sx,
|
|
16
17
|
}: {
|
|
17
18
|
placeholder?: string;
|
|
18
19
|
error?: boolean;
|
|
19
20
|
inputValue?: string;
|
|
20
21
|
inputDisabled?: boolean;
|
|
22
|
+
helperText?: string;
|
|
21
23
|
sx?: SxProps;
|
|
22
24
|
} ) => {
|
|
23
25
|
const { value, setValue, disabled } = useBoundProp( stringPropTypeUtil );
|
|
@@ -33,6 +35,7 @@ export const TextControl = createControl(
|
|
|
33
35
|
onChange={ handleChange }
|
|
34
36
|
placeholder={ placeholder }
|
|
35
37
|
error={ error }
|
|
38
|
+
helperText={ helperText }
|
|
36
39
|
sx={ sx }
|
|
37
40
|
/>
|
|
38
41
|
</ControlActions>
|
package/src/index.ts
CHANGED
|
@@ -54,6 +54,7 @@ export { useFloatingActionsBar } from './components/floating-bar';
|
|
|
54
54
|
export { useBoundProp, PropProvider, PropKeyProvider } from './bound-prop-context';
|
|
55
55
|
export { ControlAdornmentsProvider } from './control-adornments/control-adornments-context';
|
|
56
56
|
export { ControlAdornments } from './control-adornments/control-adornments';
|
|
57
|
+
export { createControl } from './create-control';
|
|
57
58
|
|
|
58
59
|
export {
|
|
59
60
|
injectIntoRepeaterItemIcon,
|