@elementor/editor-editing-panel 4.2.0-854 → 4.2.0-856

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "4.2.0-854",
3
+ "version": "4.2.0-856",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,31 +39,31 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.2.0-854",
43
- "@elementor/editor-canvas": "4.2.0-854",
44
- "@elementor/editor-controls": "4.2.0-854",
45
- "@elementor/editor-documents": "4.2.0-854",
46
- "@elementor/editor-elements": "4.2.0-854",
47
- "@elementor/editor-interactions": "4.2.0-854",
48
- "@elementor/editor-notifications": "4.2.0-854",
49
- "@elementor/editor-panels": "4.2.0-854",
50
- "@elementor/editor-props": "4.2.0-854",
51
- "@elementor/editor-responsive": "4.2.0-854",
52
- "@elementor/editor-styles": "4.2.0-854",
53
- "@elementor/editor-styles-repository": "4.2.0-854",
54
- "@elementor/editor-ui": "4.2.0-854",
55
- "@elementor/editor-v1-adapters": "4.2.0-854",
56
- "@elementor/http-client": "4.2.0-854",
42
+ "@elementor/editor": "4.2.0-856",
43
+ "@elementor/editor-canvas": "4.2.0-856",
44
+ "@elementor/editor-controls": "4.2.0-856",
45
+ "@elementor/editor-documents": "4.2.0-856",
46
+ "@elementor/editor-elements": "4.2.0-856",
47
+ "@elementor/editor-interactions": "4.2.0-856",
48
+ "@elementor/editor-notifications": "4.2.0-856",
49
+ "@elementor/editor-panels": "4.2.0-856",
50
+ "@elementor/editor-props": "4.2.0-856",
51
+ "@elementor/editor-responsive": "4.2.0-856",
52
+ "@elementor/editor-styles": "4.2.0-856",
53
+ "@elementor/editor-styles-repository": "4.2.0-856",
54
+ "@elementor/editor-ui": "4.2.0-856",
55
+ "@elementor/editor-v1-adapters": "4.2.0-856",
56
+ "@elementor/http-client": "4.2.0-856",
57
57
  "@elementor/icons": "~1.75.1",
58
- "@elementor/editor-variables": "4.2.0-854",
59
- "@elementor/locations": "4.2.0-854",
60
- "@elementor/menus": "4.2.0-854",
61
- "@elementor/query": "4.2.0-854",
62
- "@elementor/schema": "4.2.0-854",
63
- "@elementor/session": "4.2.0-854",
58
+ "@elementor/editor-variables": "4.2.0-856",
59
+ "@elementor/locations": "4.2.0-856",
60
+ "@elementor/menus": "4.2.0-856",
61
+ "@elementor/query": "4.2.0-856",
62
+ "@elementor/schema": "4.2.0-856",
63
+ "@elementor/session": "4.2.0-856",
64
64
  "@elementor/ui": "1.37.5",
65
- "@elementor/utils": "4.2.0-854",
66
- "@elementor/wp-media": "4.2.0-854",
65
+ "@elementor/utils": "4.2.0-856",
66
+ "@elementor/wp-media": "4.2.0-856",
67
67
  "@wordpress/i18n": "^5.13.0"
68
68
  },
69
69
  "peerDependencies": {
@@ -1,59 +1,22 @@
1
1
  import * as React from 'react';
2
- import { NumberInput } from '@elementor/editor-controls';
3
- import { type SpanPropValue } from '@elementor/editor-props';
2
+ import { GridSpanControl } from '@elementor/editor-controls';
4
3
  import { Grid } from '@elementor/ui';
5
4
  import { __ } from '@wordpress/i18n';
6
5
 
7
6
  import { StylesField } from '../../../controls-registry/styles-field';
8
- import { useStylesField } from '../../../hooks/use-styles-field';
9
7
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
10
8
  import { StylesFieldLayout } from '../../styles-field-layout';
11
-
12
9
  type GridSpanCssProp = 'grid-column' | 'grid-row';
13
10
 
14
- const MIN_SPAN = 1;
15
-
16
11
  type GridSpanFieldProps = {
17
12
  cssProp: GridSpanCssProp;
18
13
  label: string;
19
14
  };
20
15
 
21
- const GridSpanFieldContent = ( { cssProp, label }: GridSpanFieldProps ) => {
22
- const { value, setValue, canEdit } = useStylesField< SpanPropValue | null >( cssProp, {
23
- history: { propDisplayName: label },
24
- } );
25
-
26
- const spanValue = value?.value ?? null;
27
-
28
- const handleChange = ( event: React.ChangeEvent< HTMLInputElement > ) => {
29
- const raw = event.target.value;
30
-
31
- if ( raw === '' ) {
32
- setValue( null );
33
- return;
34
- }
35
-
36
- const num = parseInt( raw, 10 );
37
-
38
- if ( Number.isNaN( num ) ) {
39
- return;
40
- }
41
-
42
- const clamped = Math.max( num, MIN_SPAN );
43
- setValue( { $$type: 'span', value: clamped } );
44
- };
45
-
16
+ const GridSpanFieldContent = ( { label }: GridSpanFieldProps ) => {
46
17
  return (
47
18
  <StylesFieldLayout label={ label } direction="column">
48
- <NumberInput
49
- size="tiny"
50
- type="number"
51
- fullWidth
52
- disabled={ ! canEdit }
53
- value={ spanValue ?? '' }
54
- onInput={ handleChange }
55
- inputProps={ { min: MIN_SPAN } }
56
- />
19
+ <GridSpanControl />
57
20
  </StylesFieldLayout>
58
21
  );
59
22
  };