@elementor/editor-controls 4.2.0-beta1 → 4.3.0-1000
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 +25 -37
- package/dist/index.d.ts +25 -37
- package/dist/index.js +26 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/components/repeater/repeater.tsx +28 -32
- package/src/components/size-control/size-input.tsx +4 -4
- package/src/controls/email-form-action-control/email-chips-field.tsx +47 -37
- package/src/controls/email-form-action-control/fields.tsx +3 -1
- package/src/controls/email-form-action-control/index.tsx +2 -4
- package/src/controls/gap-control.tsx +3 -1
- package/src/controls/size-control/types.ts +3 -10
- package/src/controls/size-control.tsx +8 -6
- package/src/utils/size-control.ts +15 -10
- package/src/utils/tracking.ts +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import { RefObject, ReactNode, FC, PropsWithChildren, ComponentProps, Dispatch, SetStateAction, ComponentType } from 'react';
|
|
3
3
|
import { SxProps, SelectProps, UnstableColorFieldProps, StackProps, ToggleButtonProps, PopupState, Theme, FormLabelProps, Grid, TextFieldProps } from '@elementor/ui';
|
|
4
|
-
import { StringPropValue, PropTypeUtil, PropValue, PropKey, LinkPropValue, QueryFilterKeyConfig, TransformablePropValue, PropType, CreateOptions
|
|
4
|
+
import { SizePropValue, StringPropValue, PropTypeUtil, PropValue, PropKey, LinkPropValue, QueryFilterKeyConfig, TransformablePropValue, PropType, CreateOptions } from '@elementor/editor-props';
|
|
5
5
|
import * as _emotion_styled from '@emotion/styled';
|
|
6
6
|
import { StyleDefinitionState } from '@elementor/editor-styles';
|
|
7
7
|
import { EditorProps, EditorView } from '@tiptap/pm/view';
|
|
@@ -50,19 +50,19 @@ type Props$c = {
|
|
|
50
50
|
};
|
|
51
51
|
declare const MentionTextAreaControl: ControlComponent$1<({ placeholder, ariaLabel, suggestions: allSuggestions, rows, triggerPosition }: Props$c) => React$1.JSX.Element>;
|
|
52
52
|
|
|
53
|
+
type SizeUnit$1 = SizePropValue['value']['unit'];
|
|
54
|
+
type ExtendedOption = Extract<SizeUnit$1, 'auto' | 'custom'>;
|
|
55
|
+
type Unit = Exclude<SizeUnit$1, ExtendedOption>;
|
|
53
56
|
declare const lengthUnits: readonly ["px", "%", "em", "rem", "vw", "vh", "ch"];
|
|
54
57
|
declare const angleUnits: readonly ["deg", "rad", "grad", "turn"];
|
|
55
58
|
declare const timeUnits: readonly ["s", "ms"];
|
|
56
|
-
|
|
57
|
-
type
|
|
58
|
-
type
|
|
59
|
-
|
|
60
|
-
type ExtendedOption = (typeof defaultExtendedOptions)[number];
|
|
61
|
-
type Unit$1 = LengthUnit$1 | AngleUnit$1 | TimeUnit$1;
|
|
62
|
-
declare function isUnitExtendedOption(unit: Unit$1 | ExtendedOption): unit is ExtendedOption;
|
|
59
|
+
type LengthUnit = Extract<Unit, (typeof lengthUnits)[number] | 'fr'>;
|
|
60
|
+
type AngleUnit = (typeof angleUnits)[number];
|
|
61
|
+
type TimeUnit = (typeof timeUnits)[number];
|
|
62
|
+
declare function isUnitExtendedOption(unit: SizeUnit$1): unit is ExtendedOption;
|
|
63
63
|
|
|
64
64
|
type SizeVariant$1 = 'length' | 'angle' | 'time';
|
|
65
|
-
type UnitProps<T extends readonly Unit
|
|
65
|
+
type UnitProps<T extends readonly Unit[]> = {
|
|
66
66
|
units?: T;
|
|
67
67
|
defaultUnit?: T[number];
|
|
68
68
|
};
|
|
@@ -77,13 +77,13 @@ type BaseSizeControlProps = {
|
|
|
77
77
|
id?: string;
|
|
78
78
|
ariaLabel?: string;
|
|
79
79
|
};
|
|
80
|
-
type LengthSizeControlProps = BaseSizeControlProps & UnitProps<LengthUnit
|
|
80
|
+
type LengthSizeControlProps = BaseSizeControlProps & UnitProps<LengthUnit[]> & {
|
|
81
81
|
variant: 'length';
|
|
82
82
|
};
|
|
83
|
-
type AngleSizeControlProps = BaseSizeControlProps & UnitProps<AngleUnit
|
|
83
|
+
type AngleSizeControlProps = BaseSizeControlProps & UnitProps<AngleUnit[]> & {
|
|
84
84
|
variant: 'angle';
|
|
85
85
|
};
|
|
86
|
-
type TimeSizeControlProps = BaseSizeControlProps & UnitProps<TimeUnit
|
|
86
|
+
type TimeSizeControlProps = BaseSizeControlProps & UnitProps<TimeUnit[]> & {
|
|
87
87
|
variant: 'time';
|
|
88
88
|
};
|
|
89
89
|
type SizeControlProps = LengthSizeControlProps | AngleSizeControlProps | TimeSizeControlProps;
|
|
@@ -530,12 +530,6 @@ type EnhancedPropKeyContextValue<T, P> = PropKeyContextValue<T, P> & {
|
|
|
530
530
|
declare function useBoundProp<T extends PropValue = PropValue, P extends PropType = PropType>(): EnhancedPropKeyContextValue<T, P>;
|
|
531
531
|
declare function useBoundProp<TKey extends string, TValue extends PropValue>(propTypeUtil: PropTypeUtil<TKey, TValue>): UseBoundProp<TValue>;
|
|
532
532
|
|
|
533
|
-
type LengthUnit = 'px' | '%' | 'em' | 'rem' | 'vw' | 'vh' | 'ch';
|
|
534
|
-
type AngleUnit = 'deg' | 'rad' | 'grad' | 'turn';
|
|
535
|
-
type TimeUnit = 's' | 'ms';
|
|
536
|
-
type Unit = LengthUnit | AngleUnit | TimeUnit;
|
|
537
|
-
type ExtendedSizeOption = 'auto' | 'custom';
|
|
538
|
-
type SizeUnit$1 = Unit | ExtendedSizeOption;
|
|
539
533
|
type SizeVariant = 'length' | 'angle' | 'time';
|
|
540
534
|
type SetSizeValue<T> = (value: T, options?: CreateOptions, meta?: SetValueMeta) => void;
|
|
541
535
|
|
|
@@ -659,21 +653,7 @@ type SortableItemSettings<T> = BaseItemSettings<T> & {
|
|
|
659
653
|
index: number;
|
|
660
654
|
}) => string;
|
|
661
655
|
};
|
|
662
|
-
type
|
|
663
|
-
label: string;
|
|
664
|
-
values?: T[];
|
|
665
|
-
openOnAdd?: boolean;
|
|
666
|
-
setValues: (newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta<T>) => void;
|
|
667
|
-
disabled?: boolean;
|
|
668
|
-
disableAddItemButton?: boolean;
|
|
669
|
-
addButtonInfotipContent?: React$1.ReactNode;
|
|
670
|
-
showDuplicate?: boolean;
|
|
671
|
-
showToggle?: boolean;
|
|
672
|
-
showRemove?: boolean;
|
|
673
|
-
openItem?: number;
|
|
674
|
-
isSortable: false;
|
|
675
|
-
itemSettings: BaseItemSettings<T>;
|
|
676
|
-
} | {
|
|
656
|
+
type BaseProps<T> = {
|
|
677
657
|
label: string;
|
|
678
658
|
values?: T[];
|
|
679
659
|
openOnAdd?: boolean;
|
|
@@ -685,10 +665,18 @@ type RepeaterProps<T> = {
|
|
|
685
665
|
showToggle?: boolean;
|
|
686
666
|
showRemove?: boolean;
|
|
687
667
|
openItem?: number;
|
|
668
|
+
adornment?: React$1.FC;
|
|
669
|
+
};
|
|
670
|
+
type SortableProps<T> = BaseProps<T> & {
|
|
688
671
|
isSortable?: true;
|
|
689
672
|
itemSettings: SortableItemSettings<T>;
|
|
690
673
|
};
|
|
691
|
-
|
|
674
|
+
type NonSortableProps<T> = BaseProps<T> & {
|
|
675
|
+
isSortable?: false;
|
|
676
|
+
itemSettings: BaseItemSettings<T>;
|
|
677
|
+
};
|
|
678
|
+
type RepeaterProps<T> = SortableProps<T> | NonSortableProps<T>;
|
|
679
|
+
declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, values: items, setValues: setItems, showDuplicate, showToggle, showRemove, disableAddItemButton, addButtonInfotipContent, openItem: initialOpenItem, isSortable, adornment, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
|
|
692
680
|
|
|
693
681
|
declare const PopoverGridContainer: React$1.ForwardRefExoticComponent<{
|
|
694
682
|
gap?: number;
|
|
@@ -724,8 +712,8 @@ declare const InlineEditorToolbar: ({ editor, elementId, sx }: InlineEditorToolb
|
|
|
724
712
|
|
|
725
713
|
type Props$2<TValue> = {
|
|
726
714
|
value: TValue;
|
|
727
|
-
units: Unit
|
|
728
|
-
defaultUnit?: Unit
|
|
715
|
+
units: Unit[];
|
|
716
|
+
defaultUnit?: Unit;
|
|
729
717
|
onChange: (value: TValue) => void;
|
|
730
718
|
onBlur?: (event: React$1.FocusEvent<HTMLInputElement>) => void;
|
|
731
719
|
disabled?: boolean;
|
|
@@ -884,4 +872,4 @@ declare function useTypingBuffer(options?: UseTypingBufferOptions): {
|
|
|
884
872
|
startsWith: (haystack: string, needle: string) => boolean;
|
|
885
873
|
};
|
|
886
874
|
|
|
887
|
-
export { type AdornmentComponent, type AngleUnit
|
|
875
|
+
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttachmentTypeControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, ControlActions, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateRangeControl, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, GridSpanControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, MentionTextAreaControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, type PromotionTrackingData, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryChipsControl, QueryControl, QueryFilterRepeaterControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeComponent, SizeControl, StrokeControl, StyledToggleButton, StyledToggleButtonGroup, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, TimeRangeControl, TimeStringControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeControl, UnstableSizeField, UrlControl, type UseTypingBufferOptions, type V4PromotionData, type V4PromotionKey, VideoMediaControl, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import { RefObject, ReactNode, FC, PropsWithChildren, ComponentProps, Dispatch, SetStateAction, ComponentType } from 'react';
|
|
3
3
|
import { SxProps, SelectProps, UnstableColorFieldProps, StackProps, ToggleButtonProps, PopupState, Theme, FormLabelProps, Grid, TextFieldProps } from '@elementor/ui';
|
|
4
|
-
import { StringPropValue, PropTypeUtil, PropValue, PropKey, LinkPropValue, QueryFilterKeyConfig, TransformablePropValue, PropType, CreateOptions
|
|
4
|
+
import { SizePropValue, StringPropValue, PropTypeUtil, PropValue, PropKey, LinkPropValue, QueryFilterKeyConfig, TransformablePropValue, PropType, CreateOptions } from '@elementor/editor-props';
|
|
5
5
|
import * as _emotion_styled from '@emotion/styled';
|
|
6
6
|
import { StyleDefinitionState } from '@elementor/editor-styles';
|
|
7
7
|
import { EditorProps, EditorView } from '@tiptap/pm/view';
|
|
@@ -50,19 +50,19 @@ type Props$c = {
|
|
|
50
50
|
};
|
|
51
51
|
declare const MentionTextAreaControl: ControlComponent$1<({ placeholder, ariaLabel, suggestions: allSuggestions, rows, triggerPosition }: Props$c) => React$1.JSX.Element>;
|
|
52
52
|
|
|
53
|
+
type SizeUnit$1 = SizePropValue['value']['unit'];
|
|
54
|
+
type ExtendedOption = Extract<SizeUnit$1, 'auto' | 'custom'>;
|
|
55
|
+
type Unit = Exclude<SizeUnit$1, ExtendedOption>;
|
|
53
56
|
declare const lengthUnits: readonly ["px", "%", "em", "rem", "vw", "vh", "ch"];
|
|
54
57
|
declare const angleUnits: readonly ["deg", "rad", "grad", "turn"];
|
|
55
58
|
declare const timeUnits: readonly ["s", "ms"];
|
|
56
|
-
|
|
57
|
-
type
|
|
58
|
-
type
|
|
59
|
-
|
|
60
|
-
type ExtendedOption = (typeof defaultExtendedOptions)[number];
|
|
61
|
-
type Unit$1 = LengthUnit$1 | AngleUnit$1 | TimeUnit$1;
|
|
62
|
-
declare function isUnitExtendedOption(unit: Unit$1 | ExtendedOption): unit is ExtendedOption;
|
|
59
|
+
type LengthUnit = Extract<Unit, (typeof lengthUnits)[number] | 'fr'>;
|
|
60
|
+
type AngleUnit = (typeof angleUnits)[number];
|
|
61
|
+
type TimeUnit = (typeof timeUnits)[number];
|
|
62
|
+
declare function isUnitExtendedOption(unit: SizeUnit$1): unit is ExtendedOption;
|
|
63
63
|
|
|
64
64
|
type SizeVariant$1 = 'length' | 'angle' | 'time';
|
|
65
|
-
type UnitProps<T extends readonly Unit
|
|
65
|
+
type UnitProps<T extends readonly Unit[]> = {
|
|
66
66
|
units?: T;
|
|
67
67
|
defaultUnit?: T[number];
|
|
68
68
|
};
|
|
@@ -77,13 +77,13 @@ type BaseSizeControlProps = {
|
|
|
77
77
|
id?: string;
|
|
78
78
|
ariaLabel?: string;
|
|
79
79
|
};
|
|
80
|
-
type LengthSizeControlProps = BaseSizeControlProps & UnitProps<LengthUnit
|
|
80
|
+
type LengthSizeControlProps = BaseSizeControlProps & UnitProps<LengthUnit[]> & {
|
|
81
81
|
variant: 'length';
|
|
82
82
|
};
|
|
83
|
-
type AngleSizeControlProps = BaseSizeControlProps & UnitProps<AngleUnit
|
|
83
|
+
type AngleSizeControlProps = BaseSizeControlProps & UnitProps<AngleUnit[]> & {
|
|
84
84
|
variant: 'angle';
|
|
85
85
|
};
|
|
86
|
-
type TimeSizeControlProps = BaseSizeControlProps & UnitProps<TimeUnit
|
|
86
|
+
type TimeSizeControlProps = BaseSizeControlProps & UnitProps<TimeUnit[]> & {
|
|
87
87
|
variant: 'time';
|
|
88
88
|
};
|
|
89
89
|
type SizeControlProps = LengthSizeControlProps | AngleSizeControlProps | TimeSizeControlProps;
|
|
@@ -530,12 +530,6 @@ type EnhancedPropKeyContextValue<T, P> = PropKeyContextValue<T, P> & {
|
|
|
530
530
|
declare function useBoundProp<T extends PropValue = PropValue, P extends PropType = PropType>(): EnhancedPropKeyContextValue<T, P>;
|
|
531
531
|
declare function useBoundProp<TKey extends string, TValue extends PropValue>(propTypeUtil: PropTypeUtil<TKey, TValue>): UseBoundProp<TValue>;
|
|
532
532
|
|
|
533
|
-
type LengthUnit = 'px' | '%' | 'em' | 'rem' | 'vw' | 'vh' | 'ch';
|
|
534
|
-
type AngleUnit = 'deg' | 'rad' | 'grad' | 'turn';
|
|
535
|
-
type TimeUnit = 's' | 'ms';
|
|
536
|
-
type Unit = LengthUnit | AngleUnit | TimeUnit;
|
|
537
|
-
type ExtendedSizeOption = 'auto' | 'custom';
|
|
538
|
-
type SizeUnit$1 = Unit | ExtendedSizeOption;
|
|
539
533
|
type SizeVariant = 'length' | 'angle' | 'time';
|
|
540
534
|
type SetSizeValue<T> = (value: T, options?: CreateOptions, meta?: SetValueMeta) => void;
|
|
541
535
|
|
|
@@ -659,21 +653,7 @@ type SortableItemSettings<T> = BaseItemSettings<T> & {
|
|
|
659
653
|
index: number;
|
|
660
654
|
}) => string;
|
|
661
655
|
};
|
|
662
|
-
type
|
|
663
|
-
label: string;
|
|
664
|
-
values?: T[];
|
|
665
|
-
openOnAdd?: boolean;
|
|
666
|
-
setValues: (newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta<T>) => void;
|
|
667
|
-
disabled?: boolean;
|
|
668
|
-
disableAddItemButton?: boolean;
|
|
669
|
-
addButtonInfotipContent?: React$1.ReactNode;
|
|
670
|
-
showDuplicate?: boolean;
|
|
671
|
-
showToggle?: boolean;
|
|
672
|
-
showRemove?: boolean;
|
|
673
|
-
openItem?: number;
|
|
674
|
-
isSortable: false;
|
|
675
|
-
itemSettings: BaseItemSettings<T>;
|
|
676
|
-
} | {
|
|
656
|
+
type BaseProps<T> = {
|
|
677
657
|
label: string;
|
|
678
658
|
values?: T[];
|
|
679
659
|
openOnAdd?: boolean;
|
|
@@ -685,10 +665,18 @@ type RepeaterProps<T> = {
|
|
|
685
665
|
showToggle?: boolean;
|
|
686
666
|
showRemove?: boolean;
|
|
687
667
|
openItem?: number;
|
|
668
|
+
adornment?: React$1.FC;
|
|
669
|
+
};
|
|
670
|
+
type SortableProps<T> = BaseProps<T> & {
|
|
688
671
|
isSortable?: true;
|
|
689
672
|
itemSettings: SortableItemSettings<T>;
|
|
690
673
|
};
|
|
691
|
-
|
|
674
|
+
type NonSortableProps<T> = BaseProps<T> & {
|
|
675
|
+
isSortable?: false;
|
|
676
|
+
itemSettings: BaseItemSettings<T>;
|
|
677
|
+
};
|
|
678
|
+
type RepeaterProps<T> = SortableProps<T> | NonSortableProps<T>;
|
|
679
|
+
declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, values: items, setValues: setItems, showDuplicate, showToggle, showRemove, disableAddItemButton, addButtonInfotipContent, openItem: initialOpenItem, isSortable, adornment, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
|
|
692
680
|
|
|
693
681
|
declare const PopoverGridContainer: React$1.ForwardRefExoticComponent<{
|
|
694
682
|
gap?: number;
|
|
@@ -724,8 +712,8 @@ declare const InlineEditorToolbar: ({ editor, elementId, sx }: InlineEditorToolb
|
|
|
724
712
|
|
|
725
713
|
type Props$2<TValue> = {
|
|
726
714
|
value: TValue;
|
|
727
|
-
units: Unit
|
|
728
|
-
defaultUnit?: Unit
|
|
715
|
+
units: Unit[];
|
|
716
|
+
defaultUnit?: Unit;
|
|
729
717
|
onChange: (value: TValue) => void;
|
|
730
718
|
onBlur?: (event: React$1.FocusEvent<HTMLInputElement>) => void;
|
|
731
719
|
disabled?: boolean;
|
|
@@ -884,4 +872,4 @@ declare function useTypingBuffer(options?: UseTypingBufferOptions): {
|
|
|
884
872
|
startsWith: (haystack: string, needle: string) => boolean;
|
|
885
873
|
};
|
|
886
874
|
|
|
887
|
-
export { type AdornmentComponent, type AngleUnit
|
|
875
|
+
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttachmentTypeControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, ControlActions, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateRangeControl, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, GridSpanControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, MentionTextAreaControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, type PromotionTrackingData, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryChipsControl, QueryControl, QueryFilterRepeaterControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeComponent, SizeControl, StrokeControl, StyledToggleButton, StyledToggleButtonGroup, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, TimeRangeControl, TimeStringControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeControl, UnstableSizeField, UrlControl, type UseTypingBufferOptions, type V4PromotionData, type V4PromotionKey, VideoMediaControl, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
package/dist/index.js
CHANGED
|
@@ -902,11 +902,11 @@ function useTypingBuffer(options = {}) {
|
|
|
902
902
|
var lengthUnits = ["px", "%", "em", "rem", "vw", "vh", "ch"];
|
|
903
903
|
var angleUnits = ["deg", "rad", "grad", "turn"];
|
|
904
904
|
var timeUnits = ["s", "ms"];
|
|
905
|
-
var defaultExtendedOptions = ["auto", "custom"];
|
|
906
905
|
var DEFAULT_UNIT = "px";
|
|
907
906
|
var DEFAULT_SIZE = NaN;
|
|
907
|
+
var extendedOptions = ["auto", "custom"];
|
|
908
908
|
function isUnitExtendedOption(unit) {
|
|
909
|
-
return
|
|
909
|
+
return extendedOptions.includes(unit);
|
|
910
910
|
}
|
|
911
911
|
|
|
912
912
|
// src/components/size-control/text-field-inner-selection.tsx
|
|
@@ -1236,13 +1236,13 @@ var TextFieldPopover = (props) => {
|
|
|
1236
1236
|
var import_react12 = require("react");
|
|
1237
1237
|
function useSizeExtendedOptions(options, disableCustom) {
|
|
1238
1238
|
return (0, import_react12.useMemo)(() => {
|
|
1239
|
-
const
|
|
1240
|
-
if (!disableCustom && !
|
|
1241
|
-
|
|
1239
|
+
const extendedOptions2 = [...options];
|
|
1240
|
+
if (!disableCustom && !extendedOptions2.includes("custom")) {
|
|
1241
|
+
extendedOptions2.push("custom");
|
|
1242
1242
|
} else if (options.includes("custom")) {
|
|
1243
|
-
|
|
1243
|
+
extendedOptions2.splice(extendedOptions2.indexOf("custom"), 1);
|
|
1244
1244
|
}
|
|
1245
|
-
return
|
|
1245
|
+
return extendedOptions2;
|
|
1246
1246
|
}, [options, disableCustom]);
|
|
1247
1247
|
}
|
|
1248
1248
|
|
|
@@ -1279,6 +1279,11 @@ var useSyncExternalState = ({
|
|
|
1279
1279
|
return [internal, setInternalValue];
|
|
1280
1280
|
};
|
|
1281
1281
|
|
|
1282
|
+
// src/controls/size-control/utils/settings/get-prop-type-settings.ts
|
|
1283
|
+
var getPropTypeSettings = (propType) => {
|
|
1284
|
+
return propType.settings;
|
|
1285
|
+
};
|
|
1286
|
+
|
|
1282
1287
|
// src/controls/size-control.tsx
|
|
1283
1288
|
var defaultSelectedUnit = {
|
|
1284
1289
|
length: "px",
|
|
@@ -1299,7 +1304,7 @@ var SizeControl = createControl(
|
|
|
1299
1304
|
placeholder,
|
|
1300
1305
|
startIcon,
|
|
1301
1306
|
anchorRef,
|
|
1302
|
-
extendedOptions,
|
|
1307
|
+
extendedOptions: extendedOptions2,
|
|
1303
1308
|
disableCustom,
|
|
1304
1309
|
min = 0,
|
|
1305
1310
|
enablePropTypeUnits = false,
|
|
@@ -1316,7 +1321,7 @@ var SizeControl = createControl(
|
|
|
1316
1321
|
} = useBoundProp(import_editor_props8.sizePropTypeUtil);
|
|
1317
1322
|
const actualDefaultUnit = defaultUnit ?? externalPlaceholder?.unit ?? defaultSelectedUnit[variant];
|
|
1318
1323
|
const activeBreakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
1319
|
-
const actualExtendedOptions = useSizeExtendedOptions(
|
|
1324
|
+
const actualExtendedOptions = useSizeExtendedOptions(extendedOptions2 || [], disableCustom ?? false);
|
|
1320
1325
|
const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units2, actualExtendedOptions);
|
|
1321
1326
|
const popupState = (0, import_ui14.usePopupState)({ variant: "popover" });
|
|
1322
1327
|
const memorizedExternalState = (0, import_react14.useMemo)(
|
|
@@ -1405,7 +1410,7 @@ function resolveUnits(propType, enablePropTypeUnits, variant, externalUnits, act
|
|
|
1405
1410
|
if (!enablePropTypeUnits) {
|
|
1406
1411
|
return [...externalUnits ?? fallback, ...actualExtendedOptions || []];
|
|
1407
1412
|
}
|
|
1408
|
-
return propType
|
|
1413
|
+
return getPropTypeSettings(propType)?.available_units ?? fallback;
|
|
1409
1414
|
}
|
|
1410
1415
|
function formatSize(size, unit) {
|
|
1411
1416
|
if (isUnitExtendedOption(unit)) {
|
|
@@ -3712,11 +3717,6 @@ var resolvePlaceholder = (placeholder) => {
|
|
|
3712
3717
|
return typeof size === "number" ? size.toString() : size;
|
|
3713
3718
|
};
|
|
3714
3719
|
|
|
3715
|
-
// src/controls/size-control/utils/settings/get-prop-type-settings.ts
|
|
3716
|
-
var getPropTypeSettings = (propType) => {
|
|
3717
|
-
return propType.settings;
|
|
3718
|
-
};
|
|
3719
|
-
|
|
3720
3720
|
// src/controls/size-control/utils/settings/get-default-unit.ts
|
|
3721
3721
|
var getDefaultUnit = (propType) => {
|
|
3722
3722
|
return getPropTypeSettings(propType)?.default_unit;
|
|
@@ -5167,7 +5167,7 @@ var GapControl = ({ label }) => {
|
|
|
5167
5167
|
const disabled = sizeDisabled || directionDisabled;
|
|
5168
5168
|
const propProviderProps = {
|
|
5169
5169
|
propType,
|
|
5170
|
-
value: directionValue ?? (!isLinked ? { row:
|
|
5170
|
+
value: directionValue ?? (!isLinked ? { row: directionPlaceholder?.row, column: directionPlaceholder?.column } : null),
|
|
5171
5171
|
setValue: (directions) => {
|
|
5172
5172
|
const entries = Object.entries(directions);
|
|
5173
5173
|
const filtered = entries.filter(([, value]) => Boolean(value));
|
|
@@ -7309,7 +7309,6 @@ var import_i18n53 = require("@wordpress/i18n");
|
|
|
7309
7309
|
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
7310
7310
|
var import_events2 = require("@elementor/events");
|
|
7311
7311
|
var getBaseEventProperties = (data, config) => ({
|
|
7312
|
-
app_type: config?.appTypes?.editor ?? "editor",
|
|
7313
7312
|
window_name: config?.appTypes?.editor ?? "editor",
|
|
7314
7313
|
interaction_type: config?.triggers?.click ?? "Click",
|
|
7315
7314
|
target_name: data.target_name,
|
|
@@ -8312,7 +8311,7 @@ var shouldShowMentionsInfo = () => {
|
|
|
8312
8311
|
};
|
|
8313
8312
|
|
|
8314
8313
|
// src/controls/email-form-action-control/email-chips-field.tsx
|
|
8315
|
-
var
|
|
8314
|
+
var EmailChipsControl = createControl(({ placeholder }) => {
|
|
8316
8315
|
const { value, setValue, disabled } = useBoundProp(import_editor_props65.stringArrayPropTypeUtil);
|
|
8317
8316
|
const [inputValue, setInputValue] = (0, import_react69.useState)("");
|
|
8318
8317
|
const items2 = value || [];
|
|
@@ -8348,7 +8347,7 @@ var EmailChipsField = ({ fieldLabel, placeholder }) => {
|
|
|
8348
8347
|
tryAddChip(inputValue);
|
|
8349
8348
|
}
|
|
8350
8349
|
};
|
|
8351
|
-
return /* @__PURE__ */ React116.createElement(
|
|
8350
|
+
return /* @__PURE__ */ React116.createElement(ControlActions, null, /* @__PURE__ */ React116.createElement(
|
|
8352
8351
|
import_ui100.Autocomplete,
|
|
8353
8352
|
{
|
|
8354
8353
|
fullWidth: true,
|
|
@@ -8371,8 +8370,9 @@ var EmailChipsField = ({ fieldLabel, placeholder }) => {
|
|
|
8371
8370
|
renderInput: (params) => /* @__PURE__ */ React116.createElement(import_ui100.TextField, { ...params, placeholder, onKeyDown: handleKeyDown }),
|
|
8372
8371
|
renderTags: (tagValues, getTagProps) => /* @__PURE__ */ React116.createElement(ChipsList, { getLabel: (option) => option, getTagProps, values: tagValues })
|
|
8373
8372
|
}
|
|
8374
|
-
))
|
|
8375
|
-
};
|
|
8373
|
+
));
|
|
8374
|
+
});
|
|
8375
|
+
var EmailChipsField = ({ fieldLabel, placeholder }) => /* @__PURE__ */ React116.createElement(import_ui100.Grid, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React116.createElement(import_ui100.Grid, { item: true }, /* @__PURE__ */ React116.createElement(ControlFormLabel, null, fieldLabel)), /* @__PURE__ */ React116.createElement(import_ui100.Grid, { item: true }, /* @__PURE__ */ React116.createElement(EmailChipsControl, { placeholder })));
|
|
8376
8376
|
|
|
8377
8377
|
// src/controls/email-form-action-control/email-field.tsx
|
|
8378
8378
|
var React117 = __toESM(require("react"));
|
|
@@ -8380,7 +8380,7 @@ var import_ui101 = require("@elementor/ui");
|
|
|
8380
8380
|
var EmailField = ({ bind, label, placeholder }) => /* @__PURE__ */ React117.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React117.createElement(import_ui101.Grid, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React117.createElement(import_ui101.Grid, { item: true }, /* @__PURE__ */ React117.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React117.createElement(import_ui101.Grid, { item: true }, /* @__PURE__ */ React117.createElement(TextControl, { placeholder }))));
|
|
8381
8381
|
|
|
8382
8382
|
// src/controls/email-form-action-control/fields.tsx
|
|
8383
|
-
var SendToField = ({ placeholder }) => /* @__PURE__ */ React118.createElement(EmailChipsField, { fieldLabel: (0, import_i18n57.__)("Send to", "elementor"), placeholder });
|
|
8383
|
+
var SendToField = ({ placeholder }) => /* @__PURE__ */ React118.createElement(PropKeyProvider, { bind: "to" }, /* @__PURE__ */ React118.createElement(EmailChipsField, { fieldLabel: (0, import_i18n57.__)("Send to", "elementor"), placeholder }));
|
|
8384
8384
|
var SubjectField = () => /* @__PURE__ */ React118.createElement(
|
|
8385
8385
|
EmailField,
|
|
8386
8386
|
{
|
|
@@ -8452,7 +8452,7 @@ var SendAsField = () => /* @__PURE__ */ React118.createElement(PropKeyProvider,
|
|
|
8452
8452
|
var EmailFormActionControl = createControl(
|
|
8453
8453
|
({ toPlaceholder, label }) => {
|
|
8454
8454
|
const { value, setValue, ...propContext } = useBoundProp(import_editor_props66.emailsPropTypeUtil);
|
|
8455
|
-
return /* @__PURE__ */ React119.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React119.createElement(import_ui103.Stack, { gap: 2 }, /* @__PURE__ */ React119.createElement(ControlLabel, null, label ? label + " " + (0, import_i18n58.__)("settings", "elementor") : (0, import_i18n58.__)("Email settings", "elementor")), /* @__PURE__ */ React119.createElement(
|
|
8455
|
+
return /* @__PURE__ */ React119.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React119.createElement(import_ui103.Stack, { gap: 2 }, /* @__PURE__ */ React119.createElement(ControlLabel, null, label ? label + " " + (0, import_i18n58.__)("settings", "elementor") : (0, import_i18n58.__)("Email settings", "elementor")), /* @__PURE__ */ React119.createElement(SendToField, { placeholder: toPlaceholder }), /* @__PURE__ */ React119.createElement(SubjectField, null), /* @__PURE__ */ React119.createElement(MessageField, null), /* @__PURE__ */ React119.createElement(FromEmailField, null), /* @__PURE__ */ React119.createElement(AdvancedSettings, null)));
|
|
8456
8456
|
}
|
|
8457
8457
|
);
|
|
8458
8458
|
var AdvancedSettings = () => /* @__PURE__ */ React119.createElement(import_editor_ui16.CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React119.createElement(import_ui103.Box, { sx: { pt: 2 } }, /* @__PURE__ */ React119.createElement(import_ui103.Stack, { gap: 2 }, /* @__PURE__ */ React119.createElement(FromNameField, null), /* @__PURE__ */ React119.createElement(ReplyToField, null), /* @__PURE__ */ React119.createElement(CcField, null), /* @__PURE__ */ React119.createElement(BccField, null), /* @__PURE__ */ React119.createElement(import_ui103.Divider, null), /* @__PURE__ */ React119.createElement(MetaDataField, null), /* @__PURE__ */ React119.createElement(SendAsField, null))));
|
|
@@ -8665,7 +8665,8 @@ var Repeater3 = ({
|
|
|
8665
8665
|
disableAddItemButton = false,
|
|
8666
8666
|
addButtonInfotipContent,
|
|
8667
8667
|
openItem: initialOpenItem = EMPTY_OPEN_ITEM2,
|
|
8668
|
-
isSortable = true
|
|
8668
|
+
isSortable = true,
|
|
8669
|
+
adornment = ControlAdornments
|
|
8669
8670
|
}) => {
|
|
8670
8671
|
const [openItem, setOpenItem] = (0, import_react73.useState)(initialOpenItem);
|
|
8671
8672
|
const uniqueKeys = items2.map(
|
|
@@ -8743,7 +8744,7 @@ var Repeater3 = ({
|
|
|
8743
8744
|
},
|
|
8744
8745
|
/* @__PURE__ */ React126.createElement(import_icons40.PlusIcon, { fontSize: SIZE12 })
|
|
8745
8746
|
);
|
|
8746
|
-
return /* @__PURE__ */ React126.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React126.createElement(RepeaterHeader, { label, adornment
|
|
8747
|
+
return /* @__PURE__ */ React126.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React126.createElement(RepeaterHeader, { label, adornment }, shouldShowInfotip ? /* @__PURE__ */ React126.createElement(
|
|
8747
8748
|
import_ui110.Infotip,
|
|
8748
8749
|
{
|
|
8749
8750
|
placement: "right",
|