@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/dist/index.d.mts CHANGED
@@ -4,7 +4,7 @@ export { useBoundProp } from '@elementor/editor-controls';
4
4
  import * as _elementor_locations from '@elementor/locations';
5
5
  import { StyleDefinition, StyleDefinitionVariant, StyleDefinitionState, StyleDefinitionID } from '@elementor/editor-styles';
6
6
  import * as react from 'react';
7
- import { FC, PropsWithChildren, Dispatch, ElementType as ElementType$1, ComponentType, ComponentProps } from 'react';
7
+ import { FC, PropsWithChildren, ReactNode, Dispatch, ElementType as ElementType$1, ComponentType, ComponentProps } from 'react';
8
8
  import { PopoverBody as PopoverBody$1 } from '@elementor/editor-ui';
9
9
  import { Control as Control$1, ElementControl, Element, ElementType, ControlLayout } from '@elementor/editor-elements';
10
10
  import * as _elementor_editor_props from '@elementor/editor-props';
@@ -79,7 +79,10 @@ type SectionType = {
79
79
  component?: () => react.JSX.Element;
80
80
  name: string;
81
81
  title: string;
82
- action?: react.ReactNode;
82
+ action?: {
83
+ component: ReactNode;
84
+ onClick: () => void;
85
+ };
83
86
  };
84
87
  type Props$1 = {
85
88
  section: SectionType;
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { useBoundProp } from '@elementor/editor-controls';
4
4
  import * as _elementor_locations from '@elementor/locations';
5
5
  import { StyleDefinition, StyleDefinitionVariant, StyleDefinitionState, StyleDefinitionID } from '@elementor/editor-styles';
6
6
  import * as react from 'react';
7
- import { FC, PropsWithChildren, Dispatch, ElementType as ElementType$1, ComponentType, ComponentProps } from 'react';
7
+ import { FC, PropsWithChildren, ReactNode, Dispatch, ElementType as ElementType$1, ComponentType, ComponentProps } from 'react';
8
8
  import { PopoverBody as PopoverBody$1 } from '@elementor/editor-ui';
9
9
  import { Control as Control$1, ElementControl, Element, ElementType, ControlLayout } from '@elementor/editor-elements';
10
10
  import * as _elementor_editor_props from '@elementor/editor-props';
@@ -79,7 +79,10 @@ type SectionType = {
79
79
  component?: () => react.JSX.Element;
80
80
  name: string;
81
81
  title: string;
82
- action?: react.ReactNode;
82
+ action?: {
83
+ component: ReactNode;
84
+ onClick: () => void;
85
+ };
83
86
  };
84
87
  type Props$1 = {
85
88
  section: SectionType;
package/dist/index.js CHANGED
@@ -2016,7 +2016,9 @@ function Section({ title, children, defaultExpanded = false, titleEnd, unmountOn
2016
2016
  const ref = (0, import_react19.useRef)(null);
2017
2017
  const isDisabled = !!action;
2018
2018
  const handleClick = () => {
2019
- if (!isDisabled) {
2019
+ if (isDisabled) {
2020
+ action?.onClick();
2021
+ } else {
2020
2022
  setIsOpen(!isOpen);
2021
2023
  }
2022
2024
  };
@@ -2040,7 +2042,7 @@ function Section({ title, children, defaultExpanded = false, titleEnd, unmountOn
2040
2042
  sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
2041
2043
  }
2042
2044
  ), getCollapsibleValue(titleEnd, isOpen)),
2043
- action,
2045
+ action?.component,
2044
2046
  /* @__PURE__ */ React19.createElement(
2045
2047
  import_editor_ui5.CollapseIcon,
2046
2048
  {
@@ -4961,18 +4963,27 @@ var CustomCssSection = () => {
4961
4963
  section: {
4962
4964
  name: "Custom CSS",
4963
4965
  title: (0, import_i18n58.__)("Custom CSS", "elementor"),
4964
- action: /* @__PURE__ */ React86.createElement(
4965
- import_editor_ui8.PromotionInfotip,
4966
- {
4967
- title: promotion?.title ?? "",
4968
- content: promotion?.content ?? "",
4969
- assetUrl: promotion?.image ?? "",
4970
- ctaUrl: promotion?.ctaUrl ?? "",
4971
- open: showInfoTip,
4972
- setOpen: setShowInfoTip
4973
- },
4974
- /* @__PURE__ */ React86.createElement(import_editor_ui8.PromotionChip, { onClick: () => setShowInfoTip(true) })
4975
- )
4966
+ action: {
4967
+ component: /* @__PURE__ */ React86.createElement(
4968
+ import_editor_ui8.PromotionInfotip,
4969
+ {
4970
+ title: promotion?.title ?? "",
4971
+ content: promotion?.content ?? "",
4972
+ assetUrl: promotion?.image ?? "",
4973
+ ctaUrl: promotion?.ctaUrl ?? "",
4974
+ open: showInfoTip,
4975
+ onClose: () => {
4976
+ setShowInfoTip(false);
4977
+ }
4978
+ },
4979
+ /* @__PURE__ */ React86.createElement(import_editor_ui8.PromotionChip, null)
4980
+ ),
4981
+ onClick: () => {
4982
+ if (!showInfoTip) {
4983
+ setShowInfoTip(true);
4984
+ }
4985
+ }
4986
+ }
4976
4987
  }
4977
4988
  }
4978
4989
  );