@elementor/editor-editing-panel 4.3.0-955 → 4.3.0-956

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.3.0-955",
3
+ "version": "4.3.0-956",
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.3.0-955",
43
- "@elementor/editor-canvas": "4.3.0-955",
44
- "@elementor/editor-controls": "4.3.0-955",
45
- "@elementor/editor-documents": "4.3.0-955",
46
- "@elementor/editor-elements": "4.3.0-955",
47
- "@elementor/editor-interactions": "4.3.0-955",
48
- "@elementor/editor-notifications": "4.3.0-955",
49
- "@elementor/editor-panels": "4.3.0-955",
50
- "@elementor/editor-props": "4.3.0-955",
51
- "@elementor/editor-responsive": "4.3.0-955",
52
- "@elementor/editor-styles": "4.3.0-955",
53
- "@elementor/editor-styles-repository": "4.3.0-955",
54
- "@elementor/editor-ui": "4.3.0-955",
55
- "@elementor/editor-v1-adapters": "4.3.0-955",
56
- "@elementor/http-client": "4.3.0-955",
42
+ "@elementor/editor": "4.3.0-956",
43
+ "@elementor/editor-canvas": "4.3.0-956",
44
+ "@elementor/editor-controls": "4.3.0-956",
45
+ "@elementor/editor-documents": "4.3.0-956",
46
+ "@elementor/editor-elements": "4.3.0-956",
47
+ "@elementor/editor-interactions": "4.3.0-956",
48
+ "@elementor/editor-notifications": "4.3.0-956",
49
+ "@elementor/editor-panels": "4.3.0-956",
50
+ "@elementor/editor-props": "4.3.0-956",
51
+ "@elementor/editor-responsive": "4.3.0-956",
52
+ "@elementor/editor-styles": "4.3.0-956",
53
+ "@elementor/editor-styles-repository": "4.3.0-956",
54
+ "@elementor/editor-ui": "4.3.0-956",
55
+ "@elementor/editor-v1-adapters": "4.3.0-956",
56
+ "@elementor/http-client": "4.3.0-956",
57
57
  "@elementor/icons": "~1.75.1",
58
- "@elementor/editor-variables": "4.3.0-955",
59
- "@elementor/locations": "4.3.0-955",
60
- "@elementor/menus": "4.3.0-955",
61
- "@elementor/query": "4.3.0-955",
62
- "@elementor/schema": "4.3.0-955",
63
- "@elementor/session": "4.3.0-955",
58
+ "@elementor/editor-variables": "4.3.0-956",
59
+ "@elementor/locations": "4.3.0-956",
60
+ "@elementor/menus": "4.3.0-956",
61
+ "@elementor/query": "4.3.0-956",
62
+ "@elementor/schema": "4.3.0-956",
63
+ "@elementor/session": "4.3.0-956",
64
64
  "@elementor/ui": "1.37.5",
65
- "@elementor/utils": "4.3.0-955",
66
- "@elementor/wp-media": "4.3.0-955",
65
+ "@elementor/utils": "4.3.0-956",
66
+ "@elementor/wp-media": "4.3.0-956",
67
67
  "@wordpress/i18n": "^5.13.0"
68
68
  },
69
69
  "peerDependencies": {
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ControlToggleButtonGroup, type ToggleButtonGroupItem } from '@elementor/editor-controls';
2
+ import { ControlToggleButtonGroup, type ToggleButtonGroupItem, useBoundProp } from '@elementor/editor-controls';
3
3
  import { type StringPropValue } from '@elementor/editor-props';
4
4
  import { ArrowDownSmallIcon, ArrowRightIcon, LayoutDashboardIcon } from '@elementor/icons';
5
5
  import { Grid, ToggleButton, Tooltip, withDirection } from '@elementor/ui';
@@ -32,9 +32,9 @@ const directionOptions: ToggleButtonGroupItem< AutoFlowDirection >[] = [
32
32
  },
33
33
  ];
34
34
 
35
- const parseAutoFlow = ( value: string | null ): { direction: AutoFlowDirection; dense: boolean } => {
35
+ const parseAutoFlow = ( value: string | null ): { direction: AutoFlowDirection | null; dense: boolean } => {
36
36
  if ( ! value ) {
37
- return { direction: 'row', dense: false };
37
+ return { direction: null, dense: false };
38
38
  }
39
39
  const dense = value.includes( 'dense' );
40
40
  const direction = value.replace( /\s*dense\s*/, '' ).trim() as AutoFlowDirection;
@@ -46,21 +46,25 @@ const composeAutoFlow = ( direction: AutoFlowDirection, dense: boolean ): string
46
46
  };
47
47
 
48
48
  const GridAutoFlowFieldContent = () => {
49
- const { value, setValue } = useStylesField< StringPropValue | null >( 'grid-auto-flow', {
49
+ const { value, setValue, canEdit } = useStylesField< StringPropValue | null >( 'grid-auto-flow', {
50
50
  history: { propDisplayName: AUTO_FLOW_LABEL },
51
51
  } );
52
+ const { placeholder } = useBoundProp();
52
53
 
53
54
  const { direction, dense } = parseAutoFlow( value?.value ?? null );
55
+ const directionPlaceholder = parseAutoFlow( ( placeholder as StringPropValue | null )?.value ?? null ).direction;
54
56
 
55
57
  const handleDirectionChange = ( newDirection: AutoFlowDirection | null ) => {
56
58
  if ( ! newDirection ) {
59
+ setValue( null );
57
60
  return;
58
61
  }
59
62
  setValue( { $$type: 'string', value: composeAutoFlow( newDirection, dense ) } );
60
63
  };
61
64
 
62
65
  const handleDenseToggle = () => {
63
- setValue( { $$type: 'string', value: composeAutoFlow( direction, ! dense ) } );
66
+ const nextDirection = direction ?? 'row';
67
+ setValue( { $$type: 'string', value: composeAutoFlow( nextDirection, ! dense ) } );
64
68
  };
65
69
 
66
70
  return (
@@ -70,9 +74,11 @@ const GridAutoFlowFieldContent = () => {
70
74
  <ControlToggleButtonGroup
71
75
  items={ directionOptions }
72
76
  value={ direction }
77
+ placeholder={ directionPlaceholder }
73
78
  onChange={ handleDirectionChange }
74
79
  exclusive={ true }
75
80
  fullWidth={ true }
81
+ disabled={ ! canEdit }
76
82
  />
77
83
  </Grid>
78
84
  <Grid item>
@@ -83,6 +89,7 @@ const GridAutoFlowFieldContent = () => {
83
89
  onChange={ handleDenseToggle }
84
90
  size="tiny"
85
91
  aria-label={ DENSE_LABEL }
92
+ disabled={ ! canEdit }
86
93
  >
87
94
  <LayoutDashboardIcon fontSize="tiny" />
88
95
  </ToggleButton>