@elementor/editor-controls 3.33.0-99 → 3.34.3

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.
Files changed (94) hide show
  1. package/dist/index.d.mts +264 -74
  2. package/dist/index.d.ts +264 -74
  3. package/dist/index.js +2541 -1861
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +2344 -1660
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +31 -17
  8. package/src/bound-prop-context/prop-context.tsx +8 -1
  9. package/src/bound-prop-context/use-bound-prop.ts +19 -5
  10. package/src/components/autocomplete.tsx +34 -3
  11. package/src/components/conditional-control-infotip.tsx +64 -0
  12. package/src/components/{unstable-repeater → control-repeater}/actions/disable-item-action.tsx +2 -2
  13. package/src/components/{unstable-repeater → control-repeater}/actions/duplicate-item-action.tsx +10 -4
  14. package/src/components/{unstable-repeater → control-repeater}/actions/remove-item-action.tsx +2 -2
  15. package/src/components/control-repeater/context/item-context.tsx +8 -0
  16. package/src/components/{unstable-repeater → control-repeater}/context/repeater-context.tsx +24 -15
  17. package/src/components/control-repeater/control-repeater.tsx +29 -0
  18. package/src/components/{unstable-repeater → control-repeater}/index.ts +1 -2
  19. package/src/components/{unstable-repeater → control-repeater}/items/edit-item-popover.tsx +6 -20
  20. package/src/components/control-repeater/items/item.tsx +75 -0
  21. package/src/components/{unstable-repeater → control-repeater}/items/items-container.tsx +8 -13
  22. package/src/components/{unstable-repeater → control-repeater}/locations.ts +0 -4
  23. package/src/components/{unstable-repeater → control-repeater}/types.ts +1 -2
  24. package/src/components/control-toggle-button-group.tsx +79 -69
  25. package/src/components/enable-unfiltered-modal.tsx +1 -26
  26. package/src/components/icon-buttons/clear-icon-button.tsx +23 -0
  27. package/src/components/inline-editor-toolbar.tsx +137 -0
  28. package/src/components/inline-editor.tsx +111 -0
  29. package/src/components/item-selector.tsx +10 -4
  30. package/src/components/{unstable-repeater/header/header.tsx → repeater/repeater-header.tsx} +4 -12
  31. package/src/components/repeater/repeater-popover.tsx +19 -0
  32. package/src/components/repeater/repeater-tag.tsx +16 -0
  33. package/src/components/repeater/repeater.tsx +405 -0
  34. package/src/components/{sortable.tsx → repeater/sortable.tsx} +1 -1
  35. package/src/components/size-control/size-input.tsx +20 -14
  36. package/src/components/size-control/text-field-inner-selection.tsx +15 -2
  37. package/src/control-adornments/control-adornments-context.tsx +5 -4
  38. package/src/control-replacements.tsx +3 -43
  39. package/src/controls/background-control/background-control.tsx +43 -12
  40. package/src/controls/background-control/background-gradient-color-control.tsx +5 -8
  41. package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +18 -13
  42. package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +25 -16
  43. package/src/controls/box-shadow-repeater-control.tsx +38 -21
  44. package/src/controls/color-control.tsx +3 -1
  45. package/src/controls/date-time-control.tsx +108 -0
  46. package/src/controls/filter-control/drop-shadow/drop-shadow-item-content.tsx +1 -0
  47. package/src/controls/filter-control/drop-shadow/drop-shadow-item-label.tsx +10 -6
  48. package/src/controls/filter-control/filter-content.tsx +1 -1
  49. package/src/controls/filter-control/filter-repeater-control.tsx +24 -21
  50. package/src/controls/filter-control/single-size/single-size-item-content.tsx +1 -1
  51. package/src/controls/filter-control/single-size/single-size-item-label.tsx +2 -1
  52. package/src/controls/font-family-control/font-family-control.tsx +66 -55
  53. package/src/controls/html-tag-control.tsx +90 -0
  54. package/src/controls/image-media-control.tsx +2 -2
  55. package/src/controls/inline-editing-control.tsx +18 -0
  56. package/src/controls/key-value-control.tsx +8 -2
  57. package/src/controls/link-control.tsx +23 -123
  58. package/src/controls/linked-dimensions-control.tsx +71 -33
  59. package/src/controls/query-control.tsx +168 -0
  60. package/src/controls/repeatable-control.tsx +62 -27
  61. package/src/controls/select-control-wrapper.tsx +57 -0
  62. package/src/controls/select-control.tsx +9 -5
  63. package/src/controls/selection-size-control.tsx +13 -2
  64. package/src/controls/size-control.tsx +32 -59
  65. package/src/controls/svg-media-control.tsx +33 -10
  66. package/src/controls/text-area-control.tsx +5 -1
  67. package/src/controls/text-control.tsx +5 -0
  68. package/src/controls/toggle-control.tsx +11 -2
  69. package/src/controls/transform-control/functions/axis-row.tsx +1 -0
  70. package/src/controls/transform-control/transform-icon.tsx +2 -2
  71. package/src/controls/transform-control/transform-label.tsx +15 -32
  72. package/src/controls/transform-control/transform-repeater-control.tsx +42 -36
  73. package/src/controls/transform-control/{transform-base-control.tsx → transform-settings-control.tsx} +2 -2
  74. package/src/controls/transform-control/use-transform-tabs-history.tsx +1 -1
  75. package/src/controls/transition-control/data.ts +16 -1
  76. package/src/controls/transition-control/trainsition-events.ts +2 -2
  77. package/src/controls/transition-control/transition-repeater-control.tsx +137 -13
  78. package/src/controls/transition-control/transition-selector.tsx +37 -14
  79. package/src/controls/url-control.tsx +21 -16
  80. package/src/hooks/use-filtered-items-list.ts +3 -2
  81. package/src/hooks/use-repeatable-control-context.ts +3 -0
  82. package/src/hooks/use-sync-external-state.tsx +0 -1
  83. package/src/index.ts +21 -5
  84. package/src/utils/convert-toggle-options-to-atomic.tsx +33 -0
  85. package/src/utils/escape-html-attr.ts +11 -0
  86. package/src/components/css-code-editor/css-editor.styles.ts +0 -52
  87. package/src/components/css-code-editor/css-editor.tsx +0 -142
  88. package/src/components/css-code-editor/css-validation.ts +0 -75
  89. package/src/components/css-code-editor/resize-handle.tsx +0 -55
  90. package/src/components/css-code-editor/visual-content-change-protection.ts +0 -69
  91. package/src/components/repeater.tsx +0 -343
  92. package/src/components/unstable-repeater/items/item.tsx +0 -77
  93. package/src/components/unstable-repeater/unstable-repeater.tsx +0 -26
  94. /package/src/components/{unstable-repeater → control-repeater}/actions/tooltip-add-item-action.tsx +0 -0
package/dist/index.d.mts CHANGED
@@ -1,8 +1,9 @@
1
1
  import * as React$1 from 'react';
2
- import { RefObject, ReactNode, FC, PropsWithChildren, ComponentType } from 'react';
3
- import { SxProps, UnstableColorFieldProps, ToggleButtonProps, StackProps, PopupState, FormLabelProps } from '@elementor/ui';
4
- import { StringPropValue, PropTypeUtil, PropValue, PropKey, SizePropValue, PropType, CreateOptions } from '@elementor/editor-props';
2
+ import { RefObject, ReactNode, FC, PropsWithChildren, ReactElement, ComponentType } from 'react';
3
+ import { SxProps, SelectProps, UnstableColorFieldProps, ToggleButtonProps, StackProps, PopupState, Theme, FormLabelProps, Grid } from '@elementor/ui';
4
+ import { StringPropValue, PropTypeUtil, PropValue, PropKey, SizePropValue, LinkPropValue, TransformablePropValue, PropType, CreateOptions } from '@elementor/editor-props';
5
5
  import { StyleDefinitionState } from '@elementor/editor-styles';
6
+ import { Editor } from '@tiptap/react';
6
7
  import * as _elementor_locations from '@elementor/locations';
7
8
 
8
9
  type ImageControlProps = {
@@ -14,19 +15,21 @@ type ImageControlProps = {
14
15
  };
15
16
  declare const ImageControl: ControlComponent<({ sizes, showMode }: ImageControlProps) => React$1.JSX.Element>;
16
17
 
17
- declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, helperText, sx, }: {
18
+ declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, helperText, sx, ariaLabel, }: {
18
19
  placeholder?: string;
19
20
  error?: boolean;
20
21
  inputValue?: string;
21
22
  inputDisabled?: boolean;
22
23
  helperText?: string;
23
24
  sx?: SxProps;
25
+ ariaLabel?: string;
24
26
  }) => React$1.JSX.Element>;
25
27
 
26
- type Props$6 = {
28
+ type Props$8 = {
27
29
  placeholder?: string;
30
+ ariaLabel?: string;
28
31
  };
29
- declare const TextAreaControl: ControlComponent<({ placeholder }: Props$6) => React$1.JSX.Element>;
32
+ declare const TextAreaControl: ControlComponent<({ placeholder, ariaLabel }: Props$8) => React$1.JSX.Element>;
30
33
 
31
34
  declare const lengthUnits: readonly ["px", "%", "em", "rem", "vw", "vh"];
32
35
  declare const angleUnits: readonly ["deg", "rad", "grad", "turn"];
@@ -52,6 +55,8 @@ type BaseSizeControlProps = {
52
55
  min?: number;
53
56
  enablePropTypeUnits?: boolean;
54
57
  id?: string;
58
+ ariaLabel?: string;
59
+ isRepeaterControl?: boolean;
55
60
  };
56
61
  type LengthSizeControlProps = BaseSizeControlProps & UnitProps<LengthUnit[]> & {
57
62
  variant: 'length';
@@ -63,7 +68,7 @@ type TimeSizeControlProps = BaseSizeControlProps & UnitProps<TimeUnit[]> & {
63
68
  variant: 'time';
64
69
  };
65
70
  type SizeControlProps = LengthSizeControlProps | AngleSizeControlProps | TimeSizeControlProps;
66
- declare const SizeControl: ControlComponent<({ variant, defaultUnit, units, placeholder, startIcon, anchorRef, extendedOptions, disableCustom, min, enablePropTypeUnits, id, }: Omit<SizeControlProps, "variant"> & {
71
+ declare const SizeControl: ControlComponent<({ variant, defaultUnit, units, placeholder, startIcon, anchorRef, extendedOptions, disableCustom, min, enablePropTypeUnits, id, ariaLabel, }: Omit<SizeControlProps, "variant"> & {
67
72
  variant?: SizeVariant;
68
73
  }) => React$1.JSX.Element>;
69
74
 
@@ -76,22 +81,33 @@ type FilterPropName = {
76
81
  };
77
82
  declare const FilterRepeaterControl: ControlComponent<({ filterPropName }: FilterPropName) => React$1.JSX.Element>;
78
83
 
79
- type SelectOption = {
84
+ type SelectOption$1 = {
80
85
  label: string;
81
86
  value: StringPropValue['value'];
82
87
  disabled?: boolean;
83
88
  };
84
- type Props$5 = {
85
- options: SelectOption[];
89
+ type SelectControlProps = {
90
+ options: SelectOption$1[];
86
91
  onChange?: (newValue: string | null, previousValue: string | null | undefined) => void;
92
+ MenuProps?: SelectProps['MenuProps'];
93
+ ariaLabel?: string;
94
+ };
95
+ declare const SelectControl: ControlComponent<({ options, onChange, MenuProps, ariaLabel }: SelectControlProps) => React$1.JSX.Element>;
96
+
97
+ declare const collectionMethods: {
98
+ readonly 'off-canvas': () => SelectOption$1[];
99
+ };
100
+ type SelectControlWrapperProps = Parameters<typeof SelectControl>[0] & {
101
+ collectionId?: keyof typeof collectionMethods;
87
102
  };
88
- declare const SelectControl: ControlComponent<({ options, onChange }: Props$5) => React$1.JSX.Element>;
103
+ declare const SelectControlWrapper: ControlComponent<({ collectionId, options, ...props }: SelectControlWrapperProps) => React$1.JSX.Element>;
89
104
 
90
- type Props$4 = Partial<Omit<UnstableColorFieldProps, 'value' | 'onChange'>> & {
105
+ type Props$7 = Partial<Omit<UnstableColorFieldProps, 'value' | 'onChange'>> & {
91
106
  propTypeUtil?: PropTypeUtil<string, string>;
92
107
  anchorEl?: HTMLElement | null;
108
+ id?: string;
93
109
  };
94
- declare const ColorControl: ControlComponent<({ propTypeUtil, anchorEl, slotProps, ...props }: Props$4) => React$1.JSX.Element>;
110
+ declare const ColorControl: ControlComponent<({ propTypeUtil, anchorEl, slotProps, id, ...props }: Props$7) => React$1.JSX.Element>;
95
111
 
96
112
  type RenderContentProps = {
97
113
  size: ToggleButtonProps['size'];
@@ -104,7 +120,7 @@ type ToggleButtonGroupItem<TValue> = {
104
120
  };
105
121
  type ExclusiveValue<TValue> = TValue;
106
122
  type NonExclusiveValue<TValue> = TValue[];
107
- type Props$3<TValue> = {
123
+ type Props$6<TValue> = {
108
124
  disabled?: boolean;
109
125
  justify?: StackProps['justifyContent'];
110
126
  size?: ToggleButtonProps['size'];
@@ -121,7 +137,10 @@ type Props$3<TValue> = {
121
137
  value: ExclusiveValue<TValue>;
122
138
  onChange: (value: ExclusiveValue<TValue>) => void;
123
139
  });
124
- declare const ControlToggleButtonGroup: <TValue>({ justify, size, value, onChange, items, maxItems, exclusive, fullWidth, disabled, placeholder, }: Props$3<TValue>) => React$1.JSX.Element;
140
+ declare const ToggleButtonGroupUi: <TValue>(props: Props$6<TValue> & {
141
+ ref?: React$1.Ref<HTMLDivElement>;
142
+ }) => React$1.ReactElement;
143
+ declare const ControlToggleButtonGroup: <TValue>(props: Props$6<TValue>) => React$1.JSX.Element;
125
144
 
126
145
  type ToggleControlProps<T extends PropValue> = {
127
146
  options: Array<ToggleButtonGroupItem<T> & {
@@ -131,8 +150,9 @@ type ToggleControlProps<T extends PropValue> = {
131
150
  size?: ToggleButtonProps['size'];
132
151
  exclusive?: boolean;
133
152
  maxItems?: number;
153
+ convertOptions?: boolean;
134
154
  };
135
- declare const ToggleControl: ControlComponent<({ options, fullWidth, size, exclusive, maxItems, }: ToggleControlProps<StringPropValue["value"]>) => React$1.JSX.Element>;
155
+ declare const ToggleControl: ControlComponent<({ options, fullWidth, size, exclusive, maxItems, convertOptions, }: ToggleControlProps<StringPropValue["value"]>) => React$1.JSX.Element>;
136
156
 
137
157
  declare const NumberControl: ControlComponent<({ placeholder: labelPlaceholder, max, min, step, shouldForceInt, startIcon, }: {
138
158
  placeholder?: string;
@@ -144,27 +164,28 @@ declare const NumberControl: ControlComponent<({ placeholder: labelPlaceholder,
144
164
  }) => React$1.JSX.Element>;
145
165
 
146
166
  type MultiSizePropValue = Record<PropKey, SizePropValue>;
147
- type Item = {
167
+ type Item$1 = {
148
168
  icon: ReactNode;
149
169
  label: string;
150
170
  bind: PropKey;
151
171
  };
152
- type EqualUnequalItems = [Item, Item, Item, Item];
153
- type Props$2<TMultiPropType extends string, TPropValue extends MultiSizePropValue> = {
172
+ type EqualUnequalItems = [Item$1, Item$1, Item$1, Item$1];
173
+ type Props$5<TMultiPropType extends string, TPropValue extends MultiSizePropValue> = {
154
174
  label: string;
155
175
  icon: ReactNode;
156
176
  tooltipLabel: string;
157
177
  items: EqualUnequalItems;
158
178
  multiSizePropTypeUtil: PropTypeUtil<TMultiPropType, TPropValue>;
159
179
  };
160
- declare function EqualUnequalSizesControl<TMultiPropType extends string, TPropValue extends MultiSizePropValue>({ label, icon, tooltipLabel, items, multiSizePropTypeUtil, }: Props$2<TMultiPropType, TPropValue>): React$1.JSX.Element;
180
+ declare function EqualUnequalSizesControl<TMultiPropType extends string, TPropValue extends MultiSizePropValue>({ label, icon, tooltipLabel, items, multiSizePropTypeUtil, }: Props$5<TMultiPropType, TPropValue>): React$1.JSX.Element;
161
181
 
162
- declare const LinkedDimensionsControl: ({ label, isSiteRtl, extendedOptions, min, }: {
182
+ type Props$4 = {
163
183
  label: string;
164
184
  isSiteRtl?: boolean;
165
185
  extendedOptions?: ExtendedOption[];
166
186
  min?: number;
167
- }) => React$1.JSX.Element;
187
+ };
188
+ declare const LinkedDimensionsControl: ({ label, isSiteRtl, extendedOptions, min }: Props$4) => React$1.JSX.Element;
168
189
 
169
190
  type FontCategory = {
170
191
  label: string;
@@ -173,12 +194,14 @@ type FontCategory = {
173
194
  type FontFamilyControlProps = {
174
195
  fontFamilies: FontCategory[];
175
196
  sectionWidth: number;
197
+ ariaLabel?: string;
176
198
  };
177
- declare const FontFamilyControl: ControlComponent<({ fontFamilies, sectionWidth }: FontFamilyControlProps) => React$1.JSX.Element>;
199
+ declare const FontFamilyControl: ControlComponent<({ fontFamilies, sectionWidth, ariaLabel }: FontFamilyControlProps) => React$1.JSX.Element>;
178
200
 
179
201
  type SelectableItem = {
180
202
  type: 'item' | 'category';
181
203
  value: string;
204
+ disabled?: boolean;
182
205
  };
183
206
 
184
207
  type Category = {
@@ -197,11 +220,14 @@ type ItemSelectorProps = {
197
220
  icon: React$1.ElementType<{
198
221
  fontSize: string;
199
222
  }>;
223
+ disabledItems?: string[];
224
+ id?: string;
200
225
  };
201
- declare const ItemSelector: ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle, onDebounce, icon, }: ItemSelectorProps) => React$1.JSX.Element;
226
+ declare const ItemSelector: ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle, onDebounce, icon, disabledItems, id, }: ItemSelectorProps) => React$1.JSX.Element;
202
227
 
203
- declare const UrlControl: ControlComponent<({ placeholder }: {
228
+ declare const UrlControl: ControlComponent<({ placeholder, ariaLabel }: {
204
229
  placeholder?: string;
230
+ ariaLabel?: string;
205
231
  }) => React$1.JSX.Element>;
206
232
 
207
233
  type ControlProps<TControlProps = unknown> = TControlProps & {
@@ -210,17 +236,44 @@ type ControlProps<TControlProps = unknown> = TControlProps & {
210
236
  };
211
237
  };
212
238
 
213
- type Props$1 = ControlProps<{
239
+ type Props$3 = ControlProps<{
214
240
  queryOptions: {
215
- requestParams: Record<string, unknown>;
216
- endpoint: string;
241
+ params: Record<string, unknown>;
242
+ url: string;
217
243
  };
218
244
  allowCustomValues?: boolean;
219
245
  minInputLength?: number;
220
246
  placeholder?: string;
221
247
  label?: string;
248
+ ariaLabel?: string;
222
249
  }>;
223
- declare const LinkControl: ControlComponent<(props: Props$1) => React$1.JSX.Element>;
250
+ type DestinationProp = LinkPropValue['value']['destination'];
251
+ declare const LinkControl: ControlComponent<(props: Props$3) => React$1.JSX.Element>;
252
+
253
+ type SelectOption = {
254
+ label: string;
255
+ value: StringPropValue['value'];
256
+ disabled?: boolean;
257
+ };
258
+ type Props$2 = {
259
+ options: SelectOption[];
260
+ onChange?: (newValue: string | null, previousValue: string | null | undefined) => void;
261
+ fallbackLabels?: Record<string, string>;
262
+ };
263
+ declare const HtmlTagControl: ControlComponent<({ options, onChange, fallbackLabels }: Props$2) => React$1.JSX.Element>;
264
+
265
+ type Props$1 = {
266
+ queryOptions: {
267
+ params: Record<string, unknown>;
268
+ url: string;
269
+ };
270
+ allowCustomValues?: boolean;
271
+ minInputLength?: number;
272
+ placeholder?: string;
273
+ onSetValue?: (value: DestinationProp | null) => void;
274
+ ariaLabel?: string;
275
+ };
276
+ declare const QueryControl: ControlComponent<(props: Props$1) => React$1.JSX.Element>;
224
277
 
225
278
  declare const GapControl: ({ label }: {
226
279
  label: string;
@@ -244,11 +297,17 @@ type TooltipAddItemActionProps = {
244
297
  ariaLabel?: string;
245
298
  };
246
299
 
300
+ type Item<T> = {
301
+ disabled?: boolean;
302
+ } & T;
303
+ type RepeatablePropValue = TransformablePropValue<PropKey, PropValue>;
304
+
247
305
  type ChildControlConfig = {
248
306
  component: React.ComponentType;
249
307
  props?: Record<string, unknown>;
250
308
  propTypeUtil: PropTypeUtil<string, any>;
251
309
  label?: string;
310
+ isItemDisabled?: (item: Item<RepeatablePropValue>) => boolean;
252
311
  };
253
312
 
254
313
  type RepeatableControlProps = {
@@ -271,6 +330,7 @@ type KeyValueControlProps = {
271
330
  regexKey?: string;
272
331
  regexValue?: string;
273
332
  validationErrorMessage?: string;
333
+ escapeHtml?: boolean;
274
334
  getHelperText?: (key: string, value: string) => {
275
335
  keyHelper?: string;
276
336
  valueHelper?: string;
@@ -282,7 +342,7 @@ declare const PositionControl: () => React$1.JSX.Element;
282
342
 
283
343
  declare const TransformRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
284
344
 
285
- declare const TransformBaseControl: ({ popupState, anchorRef, }: {
345
+ declare const TransformSettingsControl: ({ popupState, anchorRef, }: {
286
346
  popupState: PopupState;
287
347
  anchorRef: React$1.RefObject<HTMLDivElement | null>;
288
348
  }) => React$1.JSX.Element;
@@ -301,6 +361,7 @@ type TransitionProperty = {
301
361
  label: string;
302
362
  value: string;
303
363
  unavailable?: boolean;
364
+ isDisabled?: boolean;
304
365
  };
305
366
  type TransitionCategory = {
306
367
  label: string;
@@ -313,35 +374,45 @@ declare const transitionsItemsList: {
313
374
  items: string[];
314
375
  }[];
315
376
 
316
- declare const ControlFormLabel: (props: FormLabelProps) => React$1.JSX.Element;
377
+ declare const DateTimeControl: ControlComponent<({ inputDisabled }: {
378
+ inputDisabled?: boolean;
379
+ }) => React$1.JSX.Element>;
317
380
 
318
- type CssEditorProps = {
381
+ declare const InlineEditingControl: ControlComponent<() => React$1.JSX.Element>;
382
+
383
+ type InlineEditorProps = {
319
384
  value: string;
320
- onChange: (value: string, isValid: boolean) => void;
385
+ setValue: (value: string) => void;
386
+ attributes?: Record<string, string>;
387
+ sx?: SxProps<Theme>;
388
+ showToolbar?: boolean;
321
389
  };
322
- declare const CssEditor: ({ value, onChange }: CssEditorProps) => React$1.JSX.Element;
390
+ declare const InlineEditor: React$1.ForwardRefExoticComponent<InlineEditorProps & React$1.RefAttributes<HTMLDivElement>>;
323
391
 
324
- type AnyComponentType = ComponentType<any>;
325
- declare const brandSymbol: unique symbol;
326
- type ControlComponent<TComponent extends AnyComponentType = AnyComponentType> = TComponent & {
327
- [brandSymbol]: true;
392
+ type InlineEditorToolbarProps = {
393
+ editor: Editor;
328
394
  };
329
- declare function createControl<T extends AnyComponentType>(Control: T): ControlComponent<T>;
395
+ declare const InlineEditorToolbar: ({ editor }: InlineEditorToolbarProps) => React$1.JSX.Element;
330
396
 
331
- type ControlActionsItems = Array<{
332
- id: string;
333
- MenuItem: React$1.ComponentType;
334
- }>;
335
- type ControlActionsContext = {
336
- items: ControlActionsItems;
397
+ declare const ControlFormLabel: (props: FormLabelProps) => React$1.JSX.Element;
398
+
399
+ type ClearIconButtonProps = {
400
+ onClick?: () => void;
401
+ tooltipText: React$1.ReactNode;
402
+ disabled?: boolean;
403
+ size?: 'tiny' | 'small' | 'medium' | 'large';
337
404
  };
338
- type ControlActionsProviderProps = PropsWithChildren<ControlActionsContext>;
339
- declare const ControlActionsProvider: ({ children, items }: ControlActionsProviderProps) => React$1.JSX.Element;
340
- declare const useControlActions: () => ControlActionsContext;
405
+ declare const ClearIconButton: ({ tooltipText, onClick, disabled, size }: ClearIconButtonProps) => React$1.JSX.Element;
341
406
 
342
- type SetValueMeta = {
407
+ type Action = {
408
+ type: string;
409
+ payload?: object;
410
+ };
411
+ type SetValueMeta<TAction = Action> = {
343
412
  bind?: PropKey;
344
413
  validation?: (value: PropValue) => boolean;
414
+ action?: TAction;
415
+ withHistory?: boolean;
345
416
  };
346
417
  type SetValue<T> = (value: T, options?: CreateOptions, meta?: SetValueMeta) => void;
347
418
  type PropContext<T extends PropValue, P extends PropType> = {
@@ -378,48 +449,170 @@ type UseBoundProp<TValue extends PropValue> = {
378
449
  placeholder?: TValue;
379
450
  path: PropKey[];
380
451
  restoreValue: () => void;
452
+ resetValue: () => void;
381
453
  isDisabled?: (propType: PropType) => boolean | undefined;
382
454
  disabled?: boolean;
383
455
  };
384
- declare function useBoundProp<T extends PropValue = PropValue, P extends PropType = PropType>(): PropKeyContextValue<T, P>;
456
+ type EnhancedPropKeyContextValue<T, P> = PropKeyContextValue<T, P> & {
457
+ resetValue: () => void;
458
+ };
459
+ declare function useBoundProp<T extends PropValue = PropValue, P extends PropType = PropType>(): EnhancedPropKeyContextValue<T, P>;
385
460
  declare function useBoundProp<TKey extends string, TValue extends PropValue>(propTypeUtil: PropTypeUtil<TKey, TValue>): UseBoundProp<TValue>;
386
461
 
387
- type ControlReplacement = {
388
- component: ComponentType;
389
- condition: ({ value }: ConditionArgs) => boolean;
390
- };
391
- type ConditionArgs = {
392
- value: PropValue;
462
+ type AnchorEl = HTMLElement | null;
463
+ type RepeaterItem<T> = {
464
+ disabled?: boolean;
465
+ } & T;
466
+ type RepeaterItemContentProps<T> = {
467
+ anchorEl: AnchorEl;
468
+ bind: PropKey;
469
+ value: T;
470
+ index: number;
393
471
  };
394
- type Props = PropsWithChildren<{
395
- replacements: ControlReplacement[];
472
+ type RepeaterItemContent<T> = React$1.ComponentType<RepeaterItemContentProps<T>>;
473
+ type ItemsActionPayload<T> = Array<{
474
+ index: number;
475
+ item: T;
396
476
  }>;
397
- declare const ControlReplacementsProvider: ({ replacements, children }: Props) => React$1.JSX.Element;
398
- declare const createControlReplacementsRegistry: () => {
399
- registerControlReplacement: (replacement: ControlReplacement) => void;
400
- getControlReplacements: () => ControlReplacement[];
477
+ type AddItemMeta<T> = {
478
+ type: 'add';
479
+ payload: ItemsActionPayload<T>;
480
+ };
481
+ type RemoveItemMeta<T> = {
482
+ type: 'remove';
483
+ payload: ItemsActionPayload<T>;
484
+ };
485
+ type DuplicateItemMeta<T> = {
486
+ type: 'duplicate';
487
+ payload: ItemsActionPayload<T>;
488
+ };
489
+ type ReorderItemMeta = {
490
+ type: 'reorder';
491
+ payload: {
492
+ from: number;
493
+ to: number;
494
+ };
495
+ };
496
+ type ToggleDisableItemMeta = {
497
+ type: 'toggle-disable';
498
+ };
499
+ type SetRepeaterValuesMeta<T> = SetValueMeta<AddItemMeta<T>> | SetValueMeta<RemoveItemMeta<T>> | SetValueMeta<DuplicateItemMeta<T>> | SetValueMeta<ReorderItemMeta> | SetValueMeta<ToggleDisableItemMeta>;
500
+ type BaseItemSettings<T> = {
501
+ initialValues: T;
502
+ Label: React$1.ComponentType<{
503
+ value: T;
504
+ index: number;
505
+ }>;
506
+ Icon: React$1.ComponentType<{
507
+ value: T;
508
+ }>;
509
+ Content: RepeaterItemContent<T>;
510
+ actions?: (value: T) => React$1.ReactNode;
511
+ };
512
+ type SortableItemSettings<T> = BaseItemSettings<T> & {
513
+ getId: ({ item, index }: {
514
+ item: T;
515
+ index: number;
516
+ }) => string;
517
+ };
518
+ type RepeaterProps<T> = {
519
+ label: string;
520
+ values?: T[];
521
+ openOnAdd?: boolean;
522
+ setValues: (newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta<T>) => void;
523
+ disabled?: boolean;
524
+ disableAddItemButton?: boolean;
525
+ addButtonInfotipContent?: React$1.ReactNode;
526
+ showDuplicate?: boolean;
527
+ showToggle?: boolean;
528
+ showRemove?: boolean;
529
+ openItem?: number;
530
+ isSortable: false;
531
+ itemSettings: BaseItemSettings<T>;
532
+ } | {
533
+ label: string;
534
+ values?: T[];
535
+ openOnAdd?: boolean;
536
+ setValues: (newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta<T>) => void;
537
+ disabled?: boolean;
538
+ disableAddItemButton?: boolean;
539
+ addButtonInfotipContent?: React$1.ReactNode;
540
+ showDuplicate?: boolean;
541
+ showToggle?: boolean;
542
+ showRemove?: boolean;
543
+ openItem?: number;
544
+ isSortable?: true;
545
+ itemSettings: SortableItemSettings<T>;
401
546
  };
547
+ declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, values: items, setValues: setItems, showDuplicate, showToggle, showRemove, disableAddItemButton, addButtonInfotipContent, openItem: initialOpenItem, isSortable, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
402
548
 
549
+ declare function FloatingActionsBar({ actions, children }: PropsWithChildren<{
550
+ actions: ReactElement[];
551
+ }>): React$1.JSX.Element;
403
552
  declare function useFloatingActionsBar(): {
404
553
  open: boolean;
405
554
  setOpen: React$1.Dispatch<React$1.SetStateAction<boolean>>;
406
555
  };
407
556
 
408
- type ControlAdornmentsItems = Array<{
557
+ declare const PopoverGridContainer: React$1.ForwardRefExoticComponent<{
558
+ gap?: number;
559
+ alignItems?: React$1.ComponentProps<typeof Grid>["alignItems"];
560
+ flexWrap?: React$1.ComponentProps<typeof Grid>["flexWrap"];
561
+ } & {
562
+ children?: React$1.ReactNode | undefined;
563
+ } & React$1.RefAttributes<unknown>>;
564
+
565
+ type AnyComponentType = ComponentType<any>;
566
+ declare const brandSymbol: unique symbol;
567
+ type ControlComponent<TComponent extends AnyComponentType = AnyComponentType> = TComponent & {
568
+ [brandSymbol]: true;
569
+ };
570
+ declare function createControl<T extends AnyComponentType>(Control: T): ControlComponent<T>;
571
+
572
+ type ControlActionsItems = Array<{
409
573
  id: string;
410
- Adornment: ComponentType<{
411
- customContext?: {
412
- path: string[];
413
- propType: PropType;
414
- };
415
- }>;
574
+ MenuItem: React$1.ComponentType;
416
575
  }>;
576
+ type ControlActionsContext = {
577
+ items: ControlActionsItems;
578
+ };
579
+ type ControlActionsProviderProps = PropsWithChildren<ControlActionsContext>;
580
+ declare const ControlActionsProvider: ({ children, items }: ControlActionsProviderProps) => React$1.JSX.Element;
581
+ declare const useControlActions: () => ControlActionsContext;
582
+
583
+ type AdornmentComponent = ComponentType<{
584
+ customContext?: {
585
+ path: string[];
586
+ propType: PropType;
587
+ };
588
+ }>;
589
+ type ControlAdornmentsItem = {
590
+ id: string;
591
+ Adornment: AdornmentComponent;
592
+ };
417
593
  type ControlAdornmentsContext = {
418
- items?: ControlAdornmentsItems;
594
+ items?: ControlAdornmentsItem[];
419
595
  };
420
596
  type ControlAdornmentsProviderProps = PropsWithChildren<ControlAdornmentsContext>;
421
597
  declare const ControlAdornmentsProvider: ({ children, items }: ControlAdornmentsProviderProps) => React$1.JSX.Element;
422
598
 
599
+ type ControlReplacement = {
600
+ component: ComponentType;
601
+ condition: ({ value }: ConditionArgs) => boolean;
602
+ };
603
+ type ConditionArgs = {
604
+ value: PropValue;
605
+ placeholder?: PropValue;
606
+ };
607
+ type Props = PropsWithChildren<{
608
+ replacements: ControlReplacement[];
609
+ }>;
610
+ declare const ControlReplacementsProvider: ({ replacements, children }: Props) => React$1.JSX.Element;
611
+ declare const createControlReplacementsRegistry: () => {
612
+ registerControlReplacement: (replacement: ControlReplacement) => void;
613
+ getControlReplacements: () => ControlReplacement[];
614
+ };
615
+
423
616
  declare function ControlAdornments({ customContext, }: {
424
617
  customContext?: {
425
618
  path: string[];
@@ -433,9 +626,6 @@ declare const injectIntoRepeaterItemIcon: (args: _elementor_locations.Replaceabl
433
626
  declare const injectIntoRepeaterItemLabel: (args: _elementor_locations.ReplaceableInjectArgs<{
434
627
  value: PropValue;
435
628
  }>) => void;
436
- declare const injectIntoRepeaterHeaderActions: (args: _elementor_locations.InjectArgs<{
437
- value: PropValue;
438
- }>) => void;
439
629
  declare const injectIntoRepeaterItemActions: (args: _elementor_locations.InjectArgs<{
440
630
  index: number;
441
631
  }>) => void;
@@ -448,4 +638,4 @@ type UseInternalStateOptions<TValue> = {
448
638
  };
449
639
  declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue, options?: CreateOptions, meta?: SetValueMeta) => void];
450
640
 
451
- export { type AngleUnit, AspectRatioControl, BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, CssEditor, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, ImageControl, ItemSelector, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, PopoverContent, PositionControl, PropKeyProvider, PropProvider, type PropProviderProps, RepeatableControl, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, TransformBaseControl, TransformRepeaterControl, TransitionRepeaterControl, type Unit, UrlControl, createControl, createControlReplacementsRegistry, enqueueFont, injectIntoRepeaterHeaderActions, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useFloatingActionsBar, useSyncExternalState };
641
+ export { type AdornmentComponent, type AngleUnit, AspectRatioControl, BackgroundControl, BoxShadowRepeaterControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, DateTimeControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, FloatingActionsBar, type FontCategory, FontFamilyControl, GapControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, PopoverContent, PopoverGridContainer, PositionControl, PropKeyProvider, PropProvider, type PropProviderProps, QueryControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UrlControl, createControl, createControlReplacementsRegistry, enqueueFont, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useFloatingActionsBar, useSyncExternalState };