@elementor/editor-editing-panel 3.35.0-439 → 3.35.0-441

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": "3.35.0-439",
3
+ "version": "3.35.0-441",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,27 +39,27 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "3.35.0-439",
43
- "@elementor/editor-canvas": "3.35.0-439",
44
- "@elementor/editor-controls": "3.35.0-439",
45
- "@elementor/editor-documents": "3.35.0-439",
46
- "@elementor/editor-elements": "3.35.0-439",
47
- "@elementor/editor-interactions": "3.35.0-439",
48
- "@elementor/editor-panels": "3.35.0-439",
49
- "@elementor/editor-props": "3.35.0-439",
50
- "@elementor/editor-responsive": "3.35.0-439",
51
- "@elementor/editor-styles": "3.35.0-439",
52
- "@elementor/editor-styles-repository": "3.35.0-439",
53
- "@elementor/editor-ui": "3.35.0-439",
54
- "@elementor/editor-v1-adapters": "3.35.0-439",
42
+ "@elementor/editor": "3.35.0-441",
43
+ "@elementor/editor-canvas": "3.35.0-441",
44
+ "@elementor/editor-controls": "3.35.0-441",
45
+ "@elementor/editor-documents": "3.35.0-441",
46
+ "@elementor/editor-elements": "3.35.0-441",
47
+ "@elementor/editor-interactions": "3.35.0-441",
48
+ "@elementor/editor-panels": "3.35.0-441",
49
+ "@elementor/editor-props": "3.35.0-441",
50
+ "@elementor/editor-responsive": "3.35.0-441",
51
+ "@elementor/editor-styles": "3.35.0-441",
52
+ "@elementor/editor-styles-repository": "3.35.0-441",
53
+ "@elementor/editor-ui": "3.35.0-441",
54
+ "@elementor/editor-v1-adapters": "3.35.0-441",
55
55
  "@elementor/icons": "^1.63.0",
56
- "@elementor/locations": "3.35.0-439",
57
- "@elementor/menus": "3.35.0-439",
58
- "@elementor/schema": "3.35.0-439",
59
- "@elementor/session": "3.35.0-439",
56
+ "@elementor/locations": "3.35.0-441",
57
+ "@elementor/menus": "3.35.0-441",
58
+ "@elementor/schema": "3.35.0-441",
59
+ "@elementor/session": "3.35.0-441",
60
60
  "@elementor/ui": "1.36.17",
61
- "@elementor/utils": "3.35.0-439",
62
- "@elementor/wp-media": "3.35.0-439",
61
+ "@elementor/utils": "3.35.0-441",
62
+ "@elementor/wp-media": "3.35.0-441",
63
63
  "@wordpress/i18n": "^5.13.0"
64
64
  },
65
65
  "peerDependencies": {
@@ -21,18 +21,27 @@ export const CustomCssSection = () => {
21
21
  section={ {
22
22
  name: 'Custom CSS',
23
23
  title: __( 'Custom CSS', 'elementor' ),
24
- action: (
25
- <PromotionInfotip
26
- title={ promotion?.title ?? '' }
27
- content={ promotion?.content ?? '' }
28
- assetUrl={ promotion?.image ?? '' }
29
- ctaUrl={ promotion?.ctaUrl ?? '' }
30
- open={ showInfoTip }
31
- setOpen={ setShowInfoTip }
32
- >
33
- <PromotionChip onClick={ () => setShowInfoTip( true ) } />
34
- </PromotionInfotip>
35
- ),
24
+ action: {
25
+ component: (
26
+ <PromotionInfotip
27
+ title={ promotion?.title ?? '' }
28
+ content={ promotion?.content ?? '' }
29
+ assetUrl={ promotion?.image ?? '' }
30
+ ctaUrl={ promotion?.ctaUrl ?? '' }
31
+ open={ showInfoTip }
32
+ onClose={ () => {
33
+ setShowInfoTip( false );
34
+ } }
35
+ >
36
+ <PromotionChip />
37
+ </PromotionInfotip>
38
+ ),
39
+ onClick: () => {
40
+ if ( ! showInfoTip ) {
41
+ setShowInfoTip( true );
42
+ }
43
+ },
44
+ },
36
45
  } }
37
46
  />
38
47
  );
@@ -12,7 +12,7 @@ type Props = PropsWithChildren< {
12
12
  defaultExpanded?: boolean;
13
13
  titleEnd?: CollapsibleValue< ReactNode | string >;
14
14
  unmountOnExit?: boolean;
15
- action?: ReactNode;
15
+ action?: { component: ReactNode; onClick: () => void };
16
16
  } >;
17
17
 
18
18
  export function Section( { title, children, defaultExpanded = false, titleEnd, unmountOnExit = true, action }: Props ) {
@@ -21,7 +21,9 @@ export function Section( { title, children, defaultExpanded = false, titleEnd, u
21
21
  const isDisabled = !! action;
22
22
 
23
23
  const handleClick = () => {
24
- if ( ! isDisabled ) {
24
+ if ( isDisabled ) {
25
+ action?.onClick();
26
+ } else {
25
27
  setIsOpen( ! isOpen );
26
28
  }
27
29
  };
@@ -47,7 +49,7 @@ export function Section( { title, children, defaultExpanded = false, titleEnd, u
47
49
  />
48
50
  { getCollapsibleValue( titleEnd, isOpen ) }
49
51
  </Stack>
50
- { action }
52
+ { action?.component }
51
53
  <CollapseIcon
52
54
  open={ isOpen }
53
55
  color="secondary"
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { ReactNode } from 'react';
2
3
 
3
4
  import { useDefaultPanelSettings } from '../hooks/use-default-panel-settings';
4
5
  import { Section } from './section';
@@ -8,7 +9,7 @@ type SectionType = {
8
9
  component?: () => React.JSX.Element;
9
10
  name: string;
10
11
  title: string;
11
- action?: React.ReactNode;
12
+ action?: { component: ReactNode; onClick: () => void };
12
13
  };
13
14
 
14
15
  type Props = { section: SectionType; fields?: string[]; unmountOnExit?: boolean };