@elementor/editor-ui 4.0.0-552 → 4.0.0-573
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 +28 -7
- package/dist/index.d.ts +28 -7
- package/dist/index.js +358 -263
- package/dist/index.mjs +298 -203
- package/package.json +2 -2
- package/src/components/collapsible-content.tsx +66 -0
- package/src/components/confirmation-dialog.tsx +59 -13
- package/src/components/form.tsx +8 -2
- package/src/components/{promotion-infotip.tsx → promotions/promotion-infotip.tsx} +3 -14
- package/src/components/{promotion-popover.tsx → promotions/promotion-popover.tsx} +8 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-canvas-click-handler.tsx +16 -0
- package/src/index.ts +6 -4
- /package/src/components/{promotion-alert.tsx → promotions/promotion-alert.tsx} +0 -0
- /package/src/components/{promotion-chip.tsx → promotions/promotion-chip.tsx} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _emotion_styled from '@emotion/styled';
|
|
2
2
|
import * as _mui_system from '@mui/system';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import { ReactNode, PropsWithChildren, ReactElement, ComponentProps, ElementType, ComponentType
|
|
4
|
+
import { ReactNode, PropsWithChildren, ReactElement, MouseEvent as MouseEvent$1, RefObject, ComponentProps, ElementType, ComponentType } from 'react';
|
|
5
5
|
import * as _mui_material from '@mui/material';
|
|
6
6
|
import { MenuItemProps, MenuItemTextProps, TypographyProps, AlertProps, InfotipProps, BoxProps, ButtonProps, MenuList, DialogProps, DialogContentTextProps } from '@elementor/ui';
|
|
7
7
|
|
|
@@ -10,6 +10,16 @@ declare const CollapseIcon: _emotion_styled.StyledComponent<Omit<_mui_material.S
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
}, {}, {}>;
|
|
12
12
|
|
|
13
|
+
type StaticItem<T = unknown> = T extends (...args: unknown[]) => unknown ? never : T;
|
|
14
|
+
type CallbackItem<T> = (isOpen: boolean) => T;
|
|
15
|
+
type CollapsibleValue<T> = CallbackItem<T> | StaticItem<T>;
|
|
16
|
+
type CollapsibleContentProps = React$1.PropsWithChildren<{
|
|
17
|
+
defaultOpen?: boolean;
|
|
18
|
+
titleEnd?: CollapsibleValue<ReactNode | string> | null;
|
|
19
|
+
}>;
|
|
20
|
+
declare const CollapsibleContent: ({ children, defaultOpen, titleEnd }: CollapsibleContentProps) => React$1.JSX.Element;
|
|
21
|
+
declare function getCollapsibleValue<T>(value: CollapsibleValue<T>, isOpen: boolean): T;
|
|
22
|
+
|
|
13
23
|
type EllipsisWithTooltipProps<T extends React$1.ElementType> = {
|
|
14
24
|
maxWidth?: React$1.CSSProperties['maxWidth'];
|
|
15
25
|
title: string;
|
|
@@ -88,8 +98,9 @@ declare const SearchField: ({ value, onSearch, placeholder, id, sx }: Props$1) =
|
|
|
88
98
|
|
|
89
99
|
type Props = PropsWithChildren<{
|
|
90
100
|
onSubmit?: () => void;
|
|
101
|
+
'data-testid'?: string;
|
|
91
102
|
}>;
|
|
92
|
-
declare const Form: ({ children, onSubmit }: Props) => React$1.JSX.Element;
|
|
103
|
+
declare const Form: ({ children, onSubmit, "data-testid": dataTestId }: Props) => React$1.JSX.Element;
|
|
93
104
|
|
|
94
105
|
type CtaButtonProps = {
|
|
95
106
|
href: string;
|
|
@@ -114,14 +125,15 @@ type PromotionPopoverCardProps = {
|
|
|
114
125
|
content: string;
|
|
115
126
|
ctaUrl: string;
|
|
116
127
|
ctaText?: string;
|
|
117
|
-
onClose: () => void;
|
|
128
|
+
onClose: (e: MouseEvent$1) => void;
|
|
118
129
|
};
|
|
119
130
|
type PromotionPopoverProps = React$1.PropsWithChildren<PromotionPopoverCardProps & {
|
|
120
131
|
open: boolean;
|
|
121
132
|
placement?: InfotipProps['placement'];
|
|
122
133
|
slotProps?: InfotipProps['slotProps'];
|
|
134
|
+
anchorRef?: RefObject<HTMLElement | null>;
|
|
123
135
|
}>;
|
|
124
|
-
declare const PromotionPopover: ({ children, open, placement, slotProps, ...cardProps }: PromotionPopoverProps) => React$1.JSX.Element;
|
|
136
|
+
declare const PromotionPopover: ({ children, open, placement, slotProps, anchorRef, ...cardProps }: PromotionPopoverProps) => React$1.JSX.Element;
|
|
125
137
|
|
|
126
138
|
declare const PromotionChip: React$1.ForwardRefExoticComponent<React$1.RefAttributes<HTMLDivElement>>;
|
|
127
139
|
|
|
@@ -223,16 +235,23 @@ declare const useDialog: () => {
|
|
|
223
235
|
type ConfirmationDialogProps = Pick<DialogProps, 'open' | 'onClose' | 'children'>;
|
|
224
236
|
declare const ConfirmationDialog: {
|
|
225
237
|
({ open, onClose, children }: ConfirmationDialogProps): React$1.JSX.Element;
|
|
226
|
-
Title: ({ children }:
|
|
238
|
+
Title: ({ children, icon: Icon, iconColor, }: ConfirmationDialogTitleProps) => React$1.JSX.Element;
|
|
227
239
|
Content: ({ children }: React$1.PropsWithChildren) => React$1.JSX.Element;
|
|
228
240
|
ContentText: (props: DialogContentTextProps) => React$1.JSX.Element;
|
|
229
|
-
Actions: ({ onClose, onConfirm, cancelLabel, confirmLabel, }: ConfirmationDialogActionsProps) => React$1.JSX.Element;
|
|
241
|
+
Actions: ({ onClose, onConfirm, cancelLabel, confirmLabel, color, onSuppressMessage, suppressLabel, }: ConfirmationDialogActionsProps) => React$1.JSX.Element;
|
|
230
242
|
};
|
|
243
|
+
type ConfirmationDialogTitleProps = React$1.PropsWithChildren<{
|
|
244
|
+
icon?: React$1.ElementType;
|
|
245
|
+
iconColor?: 'error' | 'secondary';
|
|
246
|
+
}>;
|
|
231
247
|
type ConfirmationDialogActionsProps = {
|
|
232
248
|
onClose: () => void;
|
|
233
249
|
onConfirm: () => void;
|
|
234
250
|
cancelLabel?: string;
|
|
235
251
|
confirmLabel?: string;
|
|
252
|
+
color?: 'error' | 'secondary';
|
|
253
|
+
onSuppressMessage?: () => void;
|
|
254
|
+
suppressLabel?: string;
|
|
236
255
|
};
|
|
237
256
|
|
|
238
257
|
declare const SectionRefContext: React$1.Context<RefObject<HTMLElement> | null>;
|
|
@@ -266,4 +285,6 @@ declare const useEditable: ({ value, onSubmit, validation, onClick, onError }: U
|
|
|
266
285
|
|
|
267
286
|
declare const useTextFieldAutoSelect: () => React$1.RefObject<HTMLInputElement>;
|
|
268
287
|
|
|
269
|
-
|
|
288
|
+
declare const useCanvasClickHandler: (isActive: boolean, onClickAway: (e: MouseEvent) => void) => void;
|
|
289
|
+
|
|
290
|
+
export { CollapseIcon, CollapsibleContent, type CollapsibleValue, ConfirmationDialog, CtaButton, EditableField, EllipsisWithTooltip, FloatingActionsBar, Form, GlobalDialog, ITEM_HEIGHT, InfoAlert, InfoTipCard, IntroductionModal, MenuItemInfotip, MenuListItem, PopoverAction, type PopoverActionProps, PopoverBody, PopoverHeader, PopoverMenuList, type PopoverMenuListProps, PromotionAlert, PromotionChip, PromotionInfotip, PromotionPopover, SaveChangesDialog, SearchField, SectionPopoverBody, SectionRefContext, StyledMenuList, ThemeProvider, type VirtualizedItem, WarningInfotip, closeDialog, getCollapsibleValue, openDialog, useCanvasClickHandler, useDialog, useEditable, useFloatingActionsBar, useSectionWidth, useTextFieldAutoSelect };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _emotion_styled from '@emotion/styled';
|
|
2
2
|
import * as _mui_system from '@mui/system';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import { ReactNode, PropsWithChildren, ReactElement, ComponentProps, ElementType, ComponentType
|
|
4
|
+
import { ReactNode, PropsWithChildren, ReactElement, MouseEvent as MouseEvent$1, RefObject, ComponentProps, ElementType, ComponentType } from 'react';
|
|
5
5
|
import * as _mui_material from '@mui/material';
|
|
6
6
|
import { MenuItemProps, MenuItemTextProps, TypographyProps, AlertProps, InfotipProps, BoxProps, ButtonProps, MenuList, DialogProps, DialogContentTextProps } from '@elementor/ui';
|
|
7
7
|
|
|
@@ -10,6 +10,16 @@ declare const CollapseIcon: _emotion_styled.StyledComponent<Omit<_mui_material.S
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
}, {}, {}>;
|
|
12
12
|
|
|
13
|
+
type StaticItem<T = unknown> = T extends (...args: unknown[]) => unknown ? never : T;
|
|
14
|
+
type CallbackItem<T> = (isOpen: boolean) => T;
|
|
15
|
+
type CollapsibleValue<T> = CallbackItem<T> | StaticItem<T>;
|
|
16
|
+
type CollapsibleContentProps = React$1.PropsWithChildren<{
|
|
17
|
+
defaultOpen?: boolean;
|
|
18
|
+
titleEnd?: CollapsibleValue<ReactNode | string> | null;
|
|
19
|
+
}>;
|
|
20
|
+
declare const CollapsibleContent: ({ children, defaultOpen, titleEnd }: CollapsibleContentProps) => React$1.JSX.Element;
|
|
21
|
+
declare function getCollapsibleValue<T>(value: CollapsibleValue<T>, isOpen: boolean): T;
|
|
22
|
+
|
|
13
23
|
type EllipsisWithTooltipProps<T extends React$1.ElementType> = {
|
|
14
24
|
maxWidth?: React$1.CSSProperties['maxWidth'];
|
|
15
25
|
title: string;
|
|
@@ -88,8 +98,9 @@ declare const SearchField: ({ value, onSearch, placeholder, id, sx }: Props$1) =
|
|
|
88
98
|
|
|
89
99
|
type Props = PropsWithChildren<{
|
|
90
100
|
onSubmit?: () => void;
|
|
101
|
+
'data-testid'?: string;
|
|
91
102
|
}>;
|
|
92
|
-
declare const Form: ({ children, onSubmit }: Props) => React$1.JSX.Element;
|
|
103
|
+
declare const Form: ({ children, onSubmit, "data-testid": dataTestId }: Props) => React$1.JSX.Element;
|
|
93
104
|
|
|
94
105
|
type CtaButtonProps = {
|
|
95
106
|
href: string;
|
|
@@ -114,14 +125,15 @@ type PromotionPopoverCardProps = {
|
|
|
114
125
|
content: string;
|
|
115
126
|
ctaUrl: string;
|
|
116
127
|
ctaText?: string;
|
|
117
|
-
onClose: () => void;
|
|
128
|
+
onClose: (e: MouseEvent$1) => void;
|
|
118
129
|
};
|
|
119
130
|
type PromotionPopoverProps = React$1.PropsWithChildren<PromotionPopoverCardProps & {
|
|
120
131
|
open: boolean;
|
|
121
132
|
placement?: InfotipProps['placement'];
|
|
122
133
|
slotProps?: InfotipProps['slotProps'];
|
|
134
|
+
anchorRef?: RefObject<HTMLElement | null>;
|
|
123
135
|
}>;
|
|
124
|
-
declare const PromotionPopover: ({ children, open, placement, slotProps, ...cardProps }: PromotionPopoverProps) => React$1.JSX.Element;
|
|
136
|
+
declare const PromotionPopover: ({ children, open, placement, slotProps, anchorRef, ...cardProps }: PromotionPopoverProps) => React$1.JSX.Element;
|
|
125
137
|
|
|
126
138
|
declare const PromotionChip: React$1.ForwardRefExoticComponent<React$1.RefAttributes<HTMLDivElement>>;
|
|
127
139
|
|
|
@@ -223,16 +235,23 @@ declare const useDialog: () => {
|
|
|
223
235
|
type ConfirmationDialogProps = Pick<DialogProps, 'open' | 'onClose' | 'children'>;
|
|
224
236
|
declare const ConfirmationDialog: {
|
|
225
237
|
({ open, onClose, children }: ConfirmationDialogProps): React$1.JSX.Element;
|
|
226
|
-
Title: ({ children }:
|
|
238
|
+
Title: ({ children, icon: Icon, iconColor, }: ConfirmationDialogTitleProps) => React$1.JSX.Element;
|
|
227
239
|
Content: ({ children }: React$1.PropsWithChildren) => React$1.JSX.Element;
|
|
228
240
|
ContentText: (props: DialogContentTextProps) => React$1.JSX.Element;
|
|
229
|
-
Actions: ({ onClose, onConfirm, cancelLabel, confirmLabel, }: ConfirmationDialogActionsProps) => React$1.JSX.Element;
|
|
241
|
+
Actions: ({ onClose, onConfirm, cancelLabel, confirmLabel, color, onSuppressMessage, suppressLabel, }: ConfirmationDialogActionsProps) => React$1.JSX.Element;
|
|
230
242
|
};
|
|
243
|
+
type ConfirmationDialogTitleProps = React$1.PropsWithChildren<{
|
|
244
|
+
icon?: React$1.ElementType;
|
|
245
|
+
iconColor?: 'error' | 'secondary';
|
|
246
|
+
}>;
|
|
231
247
|
type ConfirmationDialogActionsProps = {
|
|
232
248
|
onClose: () => void;
|
|
233
249
|
onConfirm: () => void;
|
|
234
250
|
cancelLabel?: string;
|
|
235
251
|
confirmLabel?: string;
|
|
252
|
+
color?: 'error' | 'secondary';
|
|
253
|
+
onSuppressMessage?: () => void;
|
|
254
|
+
suppressLabel?: string;
|
|
236
255
|
};
|
|
237
256
|
|
|
238
257
|
declare const SectionRefContext: React$1.Context<RefObject<HTMLElement> | null>;
|
|
@@ -266,4 +285,6 @@ declare const useEditable: ({ value, onSubmit, validation, onClick, onError }: U
|
|
|
266
285
|
|
|
267
286
|
declare const useTextFieldAutoSelect: () => React$1.RefObject<HTMLInputElement>;
|
|
268
287
|
|
|
269
|
-
|
|
288
|
+
declare const useCanvasClickHandler: (isActive: boolean, onClickAway: (e: MouseEvent) => void) => void;
|
|
289
|
+
|
|
290
|
+
export { CollapseIcon, CollapsibleContent, type CollapsibleValue, ConfirmationDialog, CtaButton, EditableField, EllipsisWithTooltip, FloatingActionsBar, Form, GlobalDialog, ITEM_HEIGHT, InfoAlert, InfoTipCard, IntroductionModal, MenuItemInfotip, MenuListItem, PopoverAction, type PopoverActionProps, PopoverBody, PopoverHeader, PopoverMenuList, type PopoverMenuListProps, PromotionAlert, PromotionChip, PromotionInfotip, PromotionPopover, SaveChangesDialog, SearchField, SectionPopoverBody, SectionRefContext, StyledMenuList, ThemeProvider, type VirtualizedItem, WarningInfotip, closeDialog, getCollapsibleValue, openDialog, useCanvasClickHandler, useDialog, useEditable, useFloatingActionsBar, useSectionWidth, useTextFieldAutoSelect };
|